Skip to content

senecajs/seneca-stytch-provider

Repository files navigation

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 Setup

// Setup - get the key value (<SECRET>) separately from a vault or
// environment variable.
const seneca = Seneca({ legacy: false })
  .test() // sets up the Seneca instance for testing: easier to read layout
  .use('promisify')
  .use('entity')
  // Get API keys using the seneca-env plugin
  .use('env', {
    var: {
      $STYTCH_PROJECTID: String,
      $STYTCH_SECRET: String,
    }
  })
  .use('provider', {
    provider: {
      stytch: {
        keys: {
          project_id: { value: '$STYTCH_PROJECTID' },
          secret: { value: '$STYTCH_SECRET' },
        }
      }
    }
  })
  // load up the 'provider/stytch/user' entity
  .use('stytch-provider')
  // it is recommended that you get seneca instance 'ready' before moving on 
  await seneca.ready()

Install

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

Options

None.

Action Patterns

Action Descriptions

« "role":"entity","base":"stytch","cmd":"list","name":"session","zone":"provider" »

No description provided.


« "role":"entity","base":"stytch","cmd":"list","name":"user","zone":"provider" »

List Stytch data into an entity


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

Load Stytch data into an entity


« "role":"entity","base":"stytch","cmd":"remove","name":"user","zone":"provider" »

Remove Stytch data from an entity


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

Update/Save Stytch data into an entity


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

Get information about the Stytch SDK.