Machine to Machine (M2M) Authorization
npm install @nitra/auth-m2mUse without cache:
``javascript
import { getGraphQLClient } from '@nitra/auth-m2m'
const qlClient = await getGraphQLClient('remote_gt', 'secret')
`
Use with cache:
`javascript
import { getGraphQLClient } from '@nitra/auth-m2m'
import KeyvFirestore from 'keyv-firestore'
const store = new KeyvFirestore({
collection: process.env.CACHE_COLLECTION
})
const qlClient = await getGraphQLClient('remote_gt', 'secret', store)
``
with process.env.KID === 'dev' getGraphQLClient return token without backend query