@nhost/stripe-graphql-js
v1.3.0
Published
Stripe GraphQL API
Readme
Expose Stripe's API as a GraphQL endpoint. Deploy as an Nhost Function and connect it as a Hasura Remote Schema to query Stripe customers, subscriptions, invoices, payment methods, and more alongside your existing data.
Quick Start
pnpm add @nhost/stripe-graphql-jsCreate a file at functions/graphql/stripe.ts:
import { createStripeGraphQLServer } from '@nhost/stripe-graphql-js';
const server = createStripeGraphQLServer();
export default server;Then register it as a Remote Schema pointing to {{NHOST_FUNCTIONS_URL}}/graphql/stripe.
See the full setup guide in the documentation.
Documentation
https://docs.nhost.io/products/graphql/guides/stripe
Development
Set the required environment variables:
export STRIPE_SECRET_KEY=sk_test_...
export NHOST_ADMIN_SECRET=your-admin-secretInstall dependencies:
pnpm installStart the development server:
pnpm devThe GraphQL server will reload every time the code changes.
Open GraphiQL: http://localhost:4000/graphql
To make requests as an admin, include the following header in GraphiQL:
{
"x-hasura-admin-secret": "<value matching your NHOST_ADMIN_SECRET>"
}