How to use @tanker/client-node - 9 common examples

To help you get started, we’ve selected a few @tanker/client-node 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 / nodejs / hello-world / main.js View on Github external
async function main () {
  console.log(`Application: using Tanker version: ${Tanker.version}`);
  // Randomize emails so that each test runs with new users
  const aliceEmail = `alice-${uuid()}@example.com`;
  const bobEmail = `bob-${uuid()}@example.com`;

  // Init tanker
  console.log('Application: init Tanker object');
  const tankerConfig = await getTankerConfig();
  const tanker = new Tanker(tankerConfig);

  // Open Bob's session to make sure his account exists
  const bob = await signUp(bobEmail);
  console.log('Application: starting Tanker session for Bob');
  await tanker.start(bob.identity);
  await tanker.registerIdentity({ passphrase: 'Bob\'s secret passphrase'});
  await tanker.stop();
  console.log('Application: stopping Tanker session for Bob');

  // Open Alice's session
  const alice = await signUp(aliceEmail);
  console.log('Application: starting Tanker session for Alice');
  await tanker.start(alice.identity);
  await tanker.registerIdentity({ passphrase: 'Alice\'s secret passphrase' });

  console.log('Application: encrypting message for Bob');
github TankerHQ / quickstart-examples / client / nodejs / hello-world / main.js View on Github external
async function main () {
  console.log(`Application: using Tanker version: ${Tanker.version}`);
  // Randomize emails so that each test runs with new users
  const aliceEmail = `alice-${uuid()}@example.com`;
  const bobEmail = `bob-${uuid()}@example.com`;

  // Init tanker
  console.log('Application: init Tanker object');
  const tankerConfig = await getTankerConfig();
  const tanker = new Tanker(tankerConfig);

  // Open Bob's session to make sure his account exists
  const bob = await signUp(bobEmail);
  console.log('Application: starting Tanker session for Bob');
  await tanker.start(bob.identity);
  await tanker.registerIdentity({ passphrase: 'Bob\'s secret passphrase'});
  await tanker.stop();
  console.log('Application: stopping Tanker session for Bob');
github TankerHQ / sdk-js / ci / compat / packages / 1.9.2 / index.spec.js View on Github external
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';

const generateTests = require('tests');

generateTests(getTankerVersion(), Tanker, generateUserToken);
github TankerHQ / sdk-js / ci / compat / packages / 1.9.4 / index.spec.js View on Github external
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';

import generateTests from 'tests';

generateTests({
  version: getTankerVersion(),
  Tanker,
  generateUserToken,
  tests: ['encrypt', 'group', 'unlock']
});
github TankerHQ / sdk-js / ci / compat / packages / 1.9.0 / index.spec.js View on Github external
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';

const generateTests = require('tests');

generateTests(getTankerVersion(), Tanker, generateUserToken);
github TankerHQ / sdk-js / ci / compat / packages / 1.9.3 / index.spec.js View on Github external
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';

const generateTests = require('tests');

generateTests(getTankerVersion(), Tanker, generateUserToken);
github TankerHQ / sdk-js / ci / compat / packages / 1.10.4 / index.spec.js View on Github external
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';
import adapter from '@tanker/datastore-pouchdb-memory';

import { generateV1Tests } from 'tests';

generateV1Tests({
  version: getTankerVersion(),
  Tanker,
  generateUserToken,
  tests: ['encrypt', 'group', 'unlock', 'revocationV1'],
  adapter,
});
github TankerHQ / sdk-js / ci / compat / packages / 1.9.1 / index.spec.js View on Github external
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';

const generateTests = require('tests');

generateTests(getTankerVersion(), Tanker, generateUserToken);
github TankerHQ / sdk-js / packages / functional-tests / src / __tests__ / client.spec.node.js View on Github external
const makeTanker = (appId: b64string): Tanker => {
  const tanker = new Tanker({
    appId,
    dataStore: { adapter: PouchDBMemory, prefix: makePrefix() },
    sdkType: 'js-functional-tests-node',
    url: tankerUrl,
  });

  return tanker;
};

@tanker/client-node

Tanker end-to-end encryption SDK for Node.js client applications

Apache-2.0
Latest version published 5 months ago

Package Health Score

65 / 100
Full package analysis