How to use the @tanker/client-browser.Tanker function in @tanker/client-browser

To help you get started, we’ve selected a few @tanker/client-browser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TankerHQ / quickstart-examples / client / web / notepad / src / Session.js View on Github external
async initTanker() {
    if (!this.user) throw new Error('Assertion error: cannot start Tanker without a user');

    const config = await this.serverApi.tankerConfig();
    this.tanker = new Tanker(config);

    const result = await this.tanker.start(this.user.identity);

    if (result === READY) {
      await this.triggerClaimIfNeeded();
    } else if (result === IDENTITY_REGISTRATION_NEEDED) {
      this.status = 'register';
    } else if (result === IDENTITY_VERIFICATION_NEEDED) {
      this.status = 'verify';
    } else {
      throw new Error(`Unexpected status ${result}`);
    }
  }
github TankerHQ / sdk-js / packages / verification-ui / example / index.js View on Github external
createIdentity(appId, appSecret, userId).then(async identity => {
  const provisionalIdentity = await createProvisionalIdentity(appId, email);
  const tanker = new Tanker({ appId, url });
  const verificationUI = new VerificationUI(tanker);
  await verificationUI.start(email, identity, provisionalIdentity);
});
github TankerHQ / sdk-js / packages / filekit / src / FileKit.js View on Github external
constructor(config: TankerOptions) {
    this.tanker = new Tanker(config);
    this.verificationUI = new VerificationUI(this.tanker);
  }