Skip to content

Commit 997350f

Browse files
authored
Merge pull request #33 from seamapi/readme-dev-and-usage
2 parents 8371336 + daeba30 commit 997350f

File tree

2 files changed

+86
-7
lines changed

2 files changed

+86
-7
lines changed

README.md

+81-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ Seam React component library.
77

88
## Description
99

10-
Zero-backend beautiful drop-in pre-built components with everything you need to get started with Seam.
10+
Zero-backend beautiful drop-in pre-built components
11+
with everything you need to get started with [Seam].
12+
13+
Play with them live in the [Storybook]!
14+
15+
[Seam]: https://www.seam.co/
16+
[Storybook]: https://seam-react.vercel.app/
1117

1218
## Installation
1319

@@ -19,6 +25,31 @@ $ npm install @seamapi/react
1925

2026
[npm]: https://www.npmjs.com/
2127

28+
## Usage
29+
30+
> Check out the [full example app](./examples/basic)!
31+
32+
1. Obtain a publishable key from the [Seam Console].
33+
2. Wrap your app with the `SeamProvider`.
34+
3. Drop in Seam components.
35+
36+
```ts
37+
import { SeamProvider, DeviceManager } from '@seamapi/react'
38+
39+
export const App = () => {
40+
return (
41+
<SeamProvider>
42+
<main>
43+
<h1>My App</h1>
44+
<DeviceManager />
45+
</main>
46+
</SeamProvider>
47+
)
48+
}
49+
```
50+
51+
[Seam Console]: https://console.seam.co/
52+
2253
## Development and Testing
2354

2455
### Quickstart
@@ -28,7 +59,7 @@ $ git clone https://github.com/seamapi/react.git
2859
$ cd react
2960
$ nvm install
3061
$ npm install
31-
$ npm run test:watch
62+
$ npm start
3263
```
3364

3465
Primary development tasks are defined under `scripts` in `package.json`
@@ -53,6 +84,9 @@ $ git clone [email protected]:seamapi/react.git
5384
### Requirements
5485

5586
You will need [Node.js] with [npm] and a [Node.js debugging] client.
87+
Alternately, develop in the cloud with [Codespaces].
88+
89+
[codespaces]: https://github.com/features/codespaces
5690

5791
Be sure that all commands run under the correct Node version, e.g.,
5892
if using [nvm], install the correct version with
@@ -78,6 +112,51 @@ $ npm install
78112
[npm]: https://www.npmjs.com/
79113
[nvm]: https://github.com/creationix/nvm
80114

115+
### Storybook
116+
117+
Develop components with [Storybook].
118+
119+
Run Storybook in development mode with
120+
121+
```
122+
$ npm start
123+
```
124+
125+
The Storybook is deployed in docs mode.
126+
Develop the Storybook in docs mode with
127+
128+
```
129+
$ npm run docs:start
130+
```
131+
132+
[Storybook]: https://storybook.js.org/
133+
134+
### Previews
135+
136+
Every pull request deploys the Storybook with the examples
137+
in a [Vercel Preview Deployment]
138+
where you may [comment directly on the preview][Vercel Comments].
139+
140+
[Vercel Preview Deployment]: https://vercel.com/docs/concepts/deployments/preview-deployments
141+
[Vercel Comments]: https://vercel.com/docs/concepts/deployments/comments
142+
143+
### Tests
144+
145+
Write tests with [Jest].
146+
147+
[Jest]: https://jestjs.io/
148+
149+
### Examples
150+
151+
Find fully working examples apps under `examples/`.
152+
Each example app is built and deployed along with the Storybook documentation.
153+
154+
Run and develop an example with, e.g.,
155+
156+
```
157+
$ npm run example:basic
158+
```
159+
81160
### Publishing
82161

83162
#### Automatic

examples/basic/src/App.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { DeviceManager, SeamProvider } from 'index.js'
44

55
export const App = (): ReactElement => {
66
return (
7-
<main>
8-
<h1>Seam Components</h1>
9-
<SeamProvider>
7+
<SeamProvider>
8+
<main>
9+
<h1>Seam Components</h1>
1010
<DeviceManager />
11-
</SeamProvider>
12-
</main>
11+
</main>
12+
</SeamProvider>
1313
)
1414
}

0 commit comments

Comments
 (0)