gcp-miniappkit-jssdk
v0.4.0
Published
JS-SDK for Toyota Wallet miniapps
Downloads
7
Readme
gcp-miniappkit-jssdk
Resources
Install
npm install --save gcp-miniappkit-jssdk
Supported platforms
From iOS11 and Android Marshmallow(6.0)
- iOS Safari 11
- Chrome mobile at least 49, strongly recommended from 69
Usage
React
import React from 'react'
import SDK from 'gcp-miniappkit-jssdk'
SDK.init('mock') // will be only mocks, use real bundle id for real response
const SomeComponents = () => {
const [result, setResult] = React.useState()
const [error, setError] = React.useState()
const getUserInfo = () => {
SDK.getUserInfo('userId').then(setResult).catch(setError)
}
return (
<div>
<button onClick={getUserInfo} />
<div>Result: {result}</div>
<div>Error: {error}</div>
</div>
)
}
Examples
Local Development
Have few examples how to use library, it also used for testing purposes. Run yarn start
or yarn build
first and run example with:
- Example React with current dev version of SDK will be deployed to https://gcp-miniappkit.omiselab.dev/
- Example React with Typescript
- Example Next.js
License
MIT ??? © OPN By asmyshlyaev177