Skip to content

Commit

Permalink
Add customer upsert to example app (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorreece authored Feb 25, 2025
1 parent ea484c4 commit 2615a9c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example-embedded-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example-embedded-app/pages/api/prismatic-auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function handler(_req, res) {
name: config.name,
organization: config.organization,
customer: config.customer,
customer_name: config.customerName,
nbf: currentTime,
iat: currentTime,
exp: currentTime + config.tokenValidSeconds,
Expand Down
1 change: 1 addition & 0 deletions example-embedded-app/prismatic/config.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const config: PrismaticConfig = {
organization:
'T3JnYW5pemF0aW9uOjAwMDAwMDAwLTAwMDAwMDAwLTAwMDAwMDAwLTAwMDAwMDAw',
customer: 'my-customer-external-id',
customerName: 'Hooli',
name: 'John Doe',
signingKey,
role: 'admin'
Expand Down
3 changes: 3 additions & 0 deletions example-embedded-app/prismatic/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export interface PrismaticConfig {
/** The external ID of the customer */
customer: string;

/** The name of the customer to create (if it does not exist) */
customerName?: string;

/** The role of the user. "user" is only used for user-level config. Generally, you'll want to use "admin". Defaults to "admin" */
role?: "admin" | "user";

Expand Down

0 comments on commit 2615a9c

Please # to comment.