// 本番環境用(*apiPathの設定は必要なし)
sdk = new Startrail({
lang: 'ja',
loginProvider: 'google',
env: 'production', // torusBuildEnv is deprecate after v1.25.0
customUi: {
logoUrl: '<https://yoursite.com/logo>',
serviceName: 'your service name'
}
})
// 開発環境用
sdk = new Startrail({
apiPath: '<https://api-stg.startrail.startbahn.jp/api/v1>',
lang: 'ja',
loginProvider: 'google',
env: 'staging', // torusBuildEnv is deprecate after v1.25.0
customUi: {
logoUrl: '<https://yoursite.com/logo>',
serviceName: 'your service name'
}
// rpcEndpoint: 'your rpc endpoint url' // IF you want to designate endpoint
})
// 本番環境用(*auth0やapiPathの設定は必要なし)
sdk = new Startrail({
authAction: { login: false, signup: true },
// { login: true, signup: false } for login on the client apps
lang: 'ja',
loginProvider: 'email_password',
env: 'production', // torusBuildEnv is deprecate after v1.25.0
redirectUrl: '<https://yoursite.com>', // Not necessary for login
customUi: {
logoUrl: '<https://yoursite.com/logo>',
serviceName: 'your service name'
}
})
// 開発環境用
sdk = new Startrail({
authAction: { login: false, signup: true },
// { login: true, signup: false } for login on the client apps
auth0ClientId: 'bjLPkbje34kWs4p5jM58q0kIW21KnuiH',
auth0Domain: '<https://startrail-staging.jp.auth0.com>',
auth0TorusConfigKey: 'startrail-auth0-staging',
apiPath: '<https://api-stg.startrail.startbahn.jp/api/v1>',
lang: 'ja',
loginProvider: 'email_password',
env: 'staging', // torusBuildEnv is deprecate after v1.25.0
redirectUrl: '[<https://yoursite.com>](<https://yoursite.com/>)', // Not necessary for login
customUi: {
logoUrl: '[<https://yoursite.com/logo>](<https://yoursite.com/logo>)',
serviceName: 'your service name'
},
// rpcEndpoint: 'your rpc endpoint url' // IF you want to designate endpoint
})
// Sometimes Mumbai test net RPC endpoint is unstable. If all of the endpoints failed, it’s possible to designate a particular endpoint in config file.
// MumbaiテストネットのRPCエンドポイントは不安定な状態になることが散見されます。その際は下記のように特定のエンドポイントを指定することも可能です。
sdk = new Startrail({
...
rpcEndpoint: '<https://matic-mumbai.chainstacklabs.com>' // example
})
右の表は各ログイン方法と環境ごとに結びつくEOAを表しています
<aside> ⚠️ Google AuthとEmail&PasswordでEOAは同じではないことにご注意ください。
同じemailでも異なるEOAを持つアカウントの登録を防ぎたい場合、御社のサーバ側で重複emailアドレスでの登録を防ぐことをお薦めします
Different EOA is allocated even if the same email is used for Google and Email&&Password authentication.
If duplicate registration of the account with the same email and different EOA should be avoided, it is recommend that your application rejects duplicate email registration on your side.
</aside>
| | Production | Staging | Other platforms with SDK(Production/Staging) | Other platforms with Torus wallet eg. Opensea | | --- | --- | --- | --- | --- | | Google Auth | EOA-1 | EOA-1 | EOA-1 / EOA-1 | EOA-1 | | Email&Password | EOA-2 | EOA-3 | EOA-2/EOA-3 | EOA-5 |
sdk.getUserInfo()
// Googleログイン時
{
email: "[email protected]"
name: "your Google account name"
profileImage: "<https://lh3.googleusercontent.com/a/image_on_google_account>"
typeOfLogin: "google"
verifier: "google"
verifierId: "[email protected]"
wallet: "startrail",
isNewUser: false // Returns if the logged in user is new to Torus wallet
}
// Email&Passwordログイン時
{
email: "[email protected]"
name: "[email protected]"
profileImage: "<https://s.gravatar.com/avatar/image_of_default_auth0_icon.png>"
typeOfLogin: "email_password"
verifier: "startrail-auth0-staging"
verifierId: "[email protected]"
wallet: "startrail",
isNewUser: false // Returns if the logged in user is new to Torus wallet
}
Blockchain Network per env setting


ユーザがsdk.login()を実行したとき
<aside>
💡 This modal is not activated as default right now. / このモーダルはデフォルトでは非表示の設定になっています。
If you want to activate it, please follow below / 表示させるには下記の設定を行なってください。
withModal: true See more details.
</aside>
<aside> ⚠️ Googleロゴは変更できない
</aside>
<aside> 📌 モーダルを非表示で使う場合は、お客様のアプリに利用規約とそのリンクを表示させてください。
</aside>
<aside> 📌 [Login with previous Google account]と書かれた黒いボタンは過去にログイン済みの場合にのみ表示され、前回ログイン時のアカウントが表示されます。
</aside>
