@slashid/jump-page 0.0.25 → 0.0.27-package.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +30 -45
  2. package/dist/_astro/app.1ce51383.js +101 -0
  3. package/dist/sdk.html +1 -1
  4. package/package/astro.config.d.mts +2 -0
  5. package/package/dist/_astro/app.1ce51383.d.ts +2 -0
  6. package/package/dist/_astro/client.e76f28bb.d.ts +7 -0
  7. package/package/dist/_astro/index.fdea1a5e.d.ts +4 -0
  8. package/package/favicon.png +0 -0
  9. package/package/main.js +13576 -0
  10. package/package/main.js.map +1 -0
  11. package/package/src/components/app/app.component.d.ts +7 -0
  12. package/package/src/components/app/app.context.d.ts +22 -0
  13. package/package/src/components/app/app.css.d.ts +1 -0
  14. package/package/src/components/app/index.d.ts +1 -0
  15. package/package/src/components/card/card.component.d.ts +10 -0
  16. package/package/src/components/card/card.css.d.ts +4 -0
  17. package/package/src/components/card/index.d.ts +1 -0
  18. package/package/src/components/flow/flow.component.d.ts +1 -0
  19. package/package/src/components/flow/flow.css.d.ts +3 -0
  20. package/package/src/components/flow/flow.error.d.ts +7 -0
  21. package/package/src/components/flow/flow.loading.d.ts +1 -0
  22. package/package/src/components/flow/flow.progress.d.ts +11 -0
  23. package/package/src/components/flow/flow.recover.d.ts +1 -0
  24. package/package/src/components/flow/flow.success.d.ts +4 -0
  25. package/package/src/components/flow/flow.types.d.ts +39 -0
  26. package/package/src/components/flow/flow.util.d.ts +2 -0
  27. package/package/src/components/flow/index.d.ts +3 -0
  28. package/package/src/components/text/index.d.ts +1 -0
  29. package/package/src/components/text/text.component.d.ts +6 -0
  30. package/package/src/components/text/use-i18n.d.ts +1 -0
  31. package/package/src/config.d.ts +7 -0
  32. package/package/src/domain/errors.d.ts +2 -0
  33. package/package/src/domain/i18n.d.ts +48 -0
  34. package/package/src/main.d.ts +10 -0
  35. package/package/style.css +1 -0
  36. package/package/vite.config.d.ts +2 -0
  37. package/package.json +1 -1
  38. package/dist/_astro/app.c9eaaa27.js +0 -96
package/README.md CHANGED
@@ -1,68 +1,53 @@
1
- # /id - SDK Jump page
1
+ # /id - SDK Verification page
2
2
 
3
- WIP jump page implementation for the SDK. SSG + client side rendering.
3
+ This package implements the SlashID verification page as a React component.
4
+ This allows self hosting the verification page as this component can be rendered in any React application.
4
5
 
5
- ## Running the app via CLI
6
+ ## Installation
6
7
 
7
- This package comes with CLI support so you can run it locally:
8
+ Use any package manager you prefer:
8
9
 
9
10
  ```bash
10
- npm install -g @slashid/jump-page
11
+ $ npm install @slashid/jump-page
11
12
  ```
12
13
 
13
- ### CLI docs
14
+ ## Usage
14
15
 
15
- ```bash
16
- Usage: sid-jump-cli serve [options]
17
-
18
- Start the development server
16
+ First import the default styles:
19
17
 
20
- Options:
21
- -p, --port <number> Port to use for the development server (default: 4321)
22
- -a, --api-url <char> SlashID API URL (default: "https://api.slashid.com")
23
- -s, --sdk-url <char> SlashID SDK URL (default: "https://cdn.slashid.com/sdk.html")
24
- -h, --help display help for command
18
+ ```jsx
19
+ import "@slashid/jump-page/style.css"
25
20
  ```
26
21
 
27
- ## Astro gotchas
22
+ Then render the `Verification` component:
28
23
 
29
- ### React hydration
30
-
31
- Astro renders a static site by default, meaning the even when using React components they won't hydrate out of the box - it is required to explicitly tell Astro which components should be hydrated by [creating an island](https://docs.astro.build/en/concepts/islands/#creating-an-island).
24
+ ```jsx
25
+ import { Verification } from "@slashid/jump-page"
32
26
 
33
- Another gotcha is that when rendering multiple React components from an Astro component, it is not enough to create an island for the parent component, but for each of the children as well. Example:
27
+ import "@slashid/jump-page/style.css"
34
28
 
35
- ```jsx
36
- // Page.astro
37
- ---
38
- import { Parent, Child } from './components';
39
- ---
40
-
41
- <Parent client:load>
42
- <Child client:load />
43
- </Parent>
29
+ export function VerificationPage() {
30
+ return <Verification />
31
+ }
44
32
  ```
45
33
 
46
- Notice how the `Child` component also needs the `client:load` attribute. Otherwise it would only be rendered when generating the site.
34
+ ## Configuration
47
35
 
48
- To prevent issues like these, encapsulate the whole client side app in a single parent component and create an island for it.
36
+ By default, the `Verification` component uses the `production` environment. Other environments can be used by passing the `environment` prop with the following values: `production`, `testing`, `sandbox`.
49
37
 
50
- ```jsx
51
- // app.tsx
52
- import { Parent, Child } from "./components";
38
+ A custom environment can be used by specifying the API and SDK URLs:
39
+
40
+ ```ts
41
+ import { Verification, type Environment } from "@slashid/jump-page"
42
+
43
+ import "@slashid/jump-page/style.css"
53
44
 
54
45
  export function App() {
55
- return (
56
- <Parent>
57
- <Child client:load />
58
- </Parent>
59
- );
46
+ const customEnvironment: Environment = { baseURL: config.baseURL, sdkURL: config.sdkURL }
47
+ return <Verification environment={environment} />
60
48
  }
49
+ ```
61
50
 
62
- // Page.astro
63
- ---
64
- import { App } from './app';
65
- ---
51
+ ## Customisation
66
52
 
67
- <App client:load />
68
- ```
53
+ Verification page can be customised using the SlashID Console.