@slashid/jump-page 0.0.26 → 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.
- package/README.md +30 -45
- package/dist/_astro/app.1ce51383.js +101 -0
- package/dist/sdk.html +1 -1
- package/package/dist/_astro/app.1ce51383.d.ts +2 -0
- package/package/main.js +12430 -1653
- package/package/main.js.map +1 -1
- package/package/src/components/app/app.component.d.ts +6 -0
- package/package/src/main.d.ts +2 -0
- package/package/style.css +1 -1
- package/package.json +1 -1
- package/dist/_astro/app.c9eaaa27.js +0 -96
- package/package/dist/_astro/app.c9eaaa27.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,68 +1,53 @@
|
|
|
1
|
-
# /id - SDK
|
|
1
|
+
# /id - SDK Verification page
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
##
|
|
6
|
+
## Installation
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Use any package manager you prefer:
|
|
8
9
|
|
|
9
10
|
```bash
|
|
10
|
-
npm install
|
|
11
|
+
$ npm install @slashid/jump-page
|
|
11
12
|
```
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
## Usage
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
Usage: sid-jump-cli serve [options]
|
|
17
|
-
|
|
18
|
-
Start the development server
|
|
16
|
+
First import the default styles:
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
22
|
+
Then render the `Verification` component:
|
|
28
23
|
|
|
29
|
-
|
|
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
|
-
|
|
27
|
+
import "@slashid/jump-page/style.css"
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
34
|
+
## Configuration
|
|
47
35
|
|
|
48
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
56
|
-
|
|
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
|
-
|
|
63
|
-
---
|
|
64
|
-
import { App } from './app';
|
|
65
|
-
---
|
|
51
|
+
## Customisation
|
|
66
52
|
|
|
67
|
-
|
|
68
|
-
```
|
|
53
|
+
Verification page can be customised using the SlashID Console.
|