How to use the @tanker/client-browser 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 / sdk-js / packages / functional-tests / src / __tests__ / client.spec.web.js View on Github external
const makeTanker = (appId: b64string): Tanker => {
  const tanker = new Tanker({
    appId,
    // $FlowIKnow adapter key is passed as a default option by @tanker/client-browser
    dataStore: { prefix: makePrefix() },
    sdkType: 'js-functional-tests-web',
    url: tankerUrl,
  });

  return tanker;
};
github TankerHQ / quickstart-examples / client / web / api-observer / src / App.js View on Github external
initTanker = async () => {
    try {
      const res = await doRequest(`${serverRoot}/config`);
      const config = await res.json();
      this.tanker = new Tanker(config);
      this.log('initTanker', config.appId);
      this.setState({ loading: false });
    } catch (e) {
      this.log(e);

      // Could it be that the server is not started yet?
      if (!(e instanceof errors.TankerError)) {
        this.log('serverHint');
      }
    }
  }