@epilot/auth

Authenticate with epilot APIs

Usage no npm install needed!

<script type="module">
  import epilotAuth from 'https://cdn.skypack.dev/@epilot/auth';
</script>

README

@epilot/auth

CI npm version bundle size License

Authenticate with epilot APIs

Quick Start

npm install --save @epilot/auth
import { authenticate } from '@epilot/auth';
import entityClient from '@epilot/entity-client';

const credentials = await authenticate({
  username: 'email@example.com',
  password: 'xxx',
});
credentials.configureClient(entityClient);

await entityClient.createEntity('contact', { fist_name: 'Example', last_name: 'Contact' });

// entityClient will be authorized using epilot OAuth tokens

CLI Usage

For convenience, you can quickly obtain a token for testing via the CLI

$ npx @epilot/auth

? Email email@example.com
? Password [hidden]

# <access token printed here>

Documentation

https://docs.epilot.io/docs/auth/authentication