This project is built using SSTv3, Pulumi, Stripe and Clerk.
-
Node.js 18 or later
-
npm or yarn
-
AWS Credentials Configured
-
Export your AWS profile
export AWS_PROFILE=<ProfileName>
git clone <repo-url>
cd agentic-api-template
npx sst@latest init
StripePubKey=<Your Stripe Publishable Key>
StripeSecretKey=<Your Stripe Secret Key>
StripeWebhookSecret=<Your Stripe Webhook Secret>
PriceID=<Your Stripe Price ID>
ClerkPubKey=<Your Clerk Publishable Key>
ClerkWebhookSecret=<Your Clerk Webhook Secret>
yarn sst secret .env --stage your-stage-name
Create a .env.test
file in the root of the project and add the following environment variables:
Provide a test access token for running the api level tests
AccessToken=<Your Access Token>
Deploy to your desired stage
yarn deploy --stage your-stage-name
The API exposes the following endpoints:
Initiates a Stripe checkout session for user subscription.
Handles Stripe webhook events for billing-related notifications.
Handles user signup events from Clerk authentication service.
Retrieves user content.
Generates new content for the user.
All endpoints are protected and require authentication via Oauth Access token from Clerk. The API is accessible at:
- Production:
api.${DOMAIN_NAME}/v1
- Other stages:
${stage}-api.${DOMAIN_NAME}/v1
CORS is enabled for
This is a reference implementation meant for starting a new api project. As of now there are no plans to add addtional features or integrations.
Please do not use this directly in production without testing and ensuring it meets your needs.
Do not submit any PRs or issues for this repository.