始めるには

Google認証を選択した場合

Email認証を選択した場合

// 本番環境用(*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について

右の表は各ログイン方法と環境ごとに結びつく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>

Different EOA’s allocation per environments/異なる環境ごとに割り当てが異なるEOA

| | 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

UI機能の紹介

Emailを使ったログイン/サインアップ用のポップアップ

いつ使われるか

モーダル

いつ使われるか

Screenshot 2022-07-22 at 15.16.29.png

署名に同意するためのポップアップ

いつ使われるか