@seneca/stytch-provider
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Seneca Stytch-Provider

Seneca Stytch-Provider is a plugin for Seneca

Provides access to the Stytch API using the Seneca provider convention. Stytch API entities are represented as Seneca entities so that they can be accessed using the Seneca entity API and messages.

See seneca-entity and the Seneca Data Entities Tutorial for more details on the Seneca entity API.

NOTE: underlying third party SDK needs to be replaced as out of date and has a security issue.

npm version build Coverage Status Known Vulnerabilities DeepScan grade Maintainability

Voxgig This open source module is sponsored and supported by Voxgig.

Quick Example

// Setup - get the key value (<SECRET>) separately from a vault or
// environment variable.
Seneca()
  // Get API keys using the seneca-env plugin
  .use('env', {
    var: {
      $STYTCH_APIKEY: String,
      $STYTCH_USERTOKEN: String,
    }
  })
  .use('provider', {
    provider: {
      stytch: {
        keys: {
          apikey: { value: '$STYTCH_APIKEY' },
          usertoken: { value: '$STYTCH_USERTOKEN' },
        }
      }
    }
  })
  .use('stytch-provider')

let board = await seneca.entity('provider/stytch/board')
  .load$('<stytch-board-id>')

Console.log('BOARD', board)

board.desc = 'New description'
board = await board.save$()

Console.log('UPDATED BOARD', board)

Install

$ npm install @seneca/stytch-provider @seneca/env

Options

  • debug : boolean false

Set plugin options when loading with:

seneca.use('StytchProvider', { name: value, ... })

Note: foo.bar in the list above means { foo: { bar: ... } }

Action Patterns

Action Descriptions

« role:entity,base:stytch,cmd:load,name:repo,zone:provider »

Load Stytch repository data into an entity.


« role:entity,base:stytch,cmd:save,name:repo,zone:provider »

Update Stytch repository data from an entity.


« sys:provider,get:info,provider:stytch »

Get information about the provider.


Package Sidebar

Install

npm i @seneca/stytch-provider

Weekly Downloads

12

Version

0.2.0

License

MIT

Unpacked Size

14.8 kB

Total Files

11

Last publish

Collaborators

  • lmscunha
  • alex01
  • lilsweetcaligula
  • stokesriona
  • rjrodger