Skip to content

Commit 35abf3d

Browse files
authored
Merge pull request #45 from seamapi/default-endpoint-on-vercel
2 parents 8571a5a + 54e2ee8 commit 35abf3d

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

.storybook/preview.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const defaultPublishableKey =
88
process.env['STORYBOOK_SEAM_PUBLISHABLE_KEY'] ??
99
'seam_pk1fGd41X_zKs0ZELRWEc8nWxiBsrTFC98'
1010

11+
const endpoint = process.env['STORYBOOK_SEAM_ENDPOINT'] ?? '/api'
12+
1113
const preview: Preview = {
1214
parameters: {
1315
actions: { argTypesRegex: '^on[A-Z].*' },
@@ -21,7 +23,10 @@ const preview: Preview = {
2123
decorators: [
2224
(Story) => {
2325
return (
24-
<SeamProvider publishableKey={defaultPublishableKey} endpoint='/api'>
26+
<SeamProvider
27+
publishableKey={defaultPublishableKey}
28+
endpoint={endpoint}
29+
>
2530
<Story />
2631
</SeamProvider>
2732
)

examples/basic/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div id="root"></div>
1010
<script>
1111
globalThis.seam = {
12-
endpoint: '/api',
12+
endpoint: '%SEAM_ENDPOINT%',
1313
publishableKey: '%SEAM_PUBLISHABLE_KEY%',
1414
}
1515
</script>

examples/basic/vite.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import createConfig from '../create-vite-config.js'
55

66
/** @type {import('vite').ResolvedConfig} */
77
export default async () => {
8+
env.SEAM_ENDPOINT ??= 'https://connect.getseam.com/'
9+
810
if (env.SEAM_PUBLISHABLE_KEY == null) {
911
// eslint-disable-next-line no-console
1012
console.warn(

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
},
7171
"dependencies": {
7272
"@tanstack/react-query": "^4.28.0",
73-
"seamapi": "^5.15.0",
73+
"seamapi": "^5.18.0",
7474
"uuid": "^9.0.0"
7575
},
7676
"devDependencies": {

vercel.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,5 @@
22
"buildCommand": "npm run docs:build",
33
"installCommand": "npm ci",
44
"outputDirectory": "docs",
5-
"cleanUrls": true,
6-
"rewrites": [
7-
{
8-
"source": "/api/:match*",
9-
"destination": "https://connect.getseam.com/:match"
10-
}
11-
]
5+
"cleanUrls": true
126
}

0 commit comments

Comments
 (0)