@equs-ai/dtk-embedded-ui 0.1.1 → 0.1.2

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/LICENSE CHANGED
@@ -4,7 +4,7 @@ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
4
4
  Parameters
5
5
 
6
6
  Licensor: EQUS, Inc.
7
- Licensed Work: EQUS Embeddable UI v.0.1.1
7
+ Licensed Work: EQUS Embeddable UI v.0.1.2
8
8
  The Licensed Work is (c) 2026 EQUS, Inc.
9
9
 
10
10
  Additional Use Grant: You may use the Licensed Work, including in
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # @equs-ai/dtk-embedded-ui
2
+
3
+ Embeddable UI for the EQUS Developer Toolkit. Add verifiable credential issuance, verification and wallet access to your own website, without building the UI yourself.
4
+
5
+ The flows open as an overlay on top of your page. Your backend keeps talking to the EQUS Developer Toolkit APIs; this package handles the user-facing part.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @equs-ai/dtk-embedded-ui
11
+ ```
12
+
13
+ The package is an ES module for the browser. TypeScript types are included.
14
+
15
+ ## Quick start
16
+
17
+ Initialize once when your app loads, then start a flow from a user action.
18
+
19
+ ```js
20
+ import { initEmbeddedUi, issueVC, presentVCs } from '@equs-ai/dtk-embedded-ui'
21
+
22
+ initEmbeddedUi({
23
+ tenant: '<YOUR_TENANT_SLUG>',
24
+ region: 'us', // "us" (default) or "eu"
25
+ })
26
+
27
+ // Issue a credential to the signed-in user
28
+ issueButton.onclick = () =>
29
+ issueVC({
30
+ // Your backend creates a credential offer and returns { refUri, uriId }
31
+ getCredentialOfferUri: () => fetch('<YOUR_BACKEND_CREATE_OFFER_ENDPOINT>').then((r) => r.json()),
32
+ // Your backend delivers the transaction code and returns
33
+ // { txCodeFetchUrl, txCodeResendUrl, txCodeResendCooldown }
34
+ deliverTxCode: (params) =>
35
+ fetch('<YOUR_BACKEND_DELIVER_TX_CODE_ENDPOINT>', {
36
+ method: 'POST',
37
+ headers: { 'Content-Type': 'application/json' },
38
+ body: JSON.stringify(params),
39
+ }).then((r) => r.json()),
40
+ userInfo: { id: '<USER_ID>', email: '<USER_EMAIL>' },
41
+ internalWallet: { platform: ['web', 'mobile'] },
42
+ onLoading: (loading) => {
43
+ /* <SHOW_OR_HIDE_YOUR_LOADER> */
44
+ },
45
+ })
46
+
47
+ // Ask the user to present credentials
48
+ verifyButton.onclick = () =>
49
+ presentVCs({
50
+ // Your backend creates a presentation request and returns { web, mobile, dc }
51
+ getReqUriAndTxId: () => fetch('<YOUR_BACKEND_CREATE_PRESENTATION_REQUEST_ENDPOINT>').then((r) => r.json()),
52
+ onSuccess: ({ txId, authResponse }) => {
53
+ /* <SEND_TO_YOUR_BACKEND_TO_VERIFY> */
54
+ },
55
+ onReject: () => {
56
+ /* <HANDLE_USER_DECLINED> */
57
+ },
58
+ onError: (error) => console.error(error),
59
+ })
60
+ ```
61
+
62
+ Replace every `<…>` value with your own. The endpoints are routes on **your** backend, which in turn call the EQUS Developer Toolkit APIs.
63
+
64
+ When your app unmounts or the user signs out, call `cleanUpEmbeddedUi()`.
65
+
66
+ ## Integration guide and API access
67
+
68
+ To get the full integration guide and access to the EQUS Developer Toolkit APIs, contact EQUS at info@equs.ai.
69
+
70
+ ## License
71
+
72
+ Licensed under the [Business Source License 1.1](./LICENSE) (`BUSL-1.1`). Licensor: EQUS, Inc.
package/embedded.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! @equs-ai/dtk-embedded-ui v0.1.1 | SPDX-License-Identifier: BUSL-1.1 | See LICENSE */
1
+ /*! @equs-ai/dtk-embedded-ui v0.1.2 | SPDX-License-Identifier: BUSL-1.1 | See LICENSE */
2
2
  export declare const enum AuthorizationResponseType {
3
3
  Plain = 0,
4
4
  Jwe = 1