You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KILT Extension API is a JavaScript/TypeScript library that provides helper functions for interacting with KILT enabled extensions.
7
-
It facilitates seamless communication between your application and KILT extensions.
6
+
import TsJsBlock from '@site/src/components/TsJsBlock';
7
+
import Tabs from '@theme/Tabs';
8
+
import TabItem from '@theme/TabItem';
8
9
9
-
## Getting Started
10
+
The KILT Extension API is a JavaScript and TypeScript library that provides helper functions for interacting with KILT extensions.
11
+
It facilitates communication between your application and KILT extensions.
10
12
11
-
Before you can communicate with KILT extensions, you must call the `initializeKiltExtensionAPI()` function to signal the API versions supported by your application.
12
-
This is crucial for the extension to inject the appropriate scripts into the website.
13
+
<!-- TODO: Possible to test code as it's browser-based? -->
Before your application can communicate with KILT extensions, call the `initializeKiltExtensionAPI()` method to signal the API versions supported by your application so the extension can inject the appropriate scripts.
This library also aids in setting up the [Well-Known DID Configuration](https://identity.foundation/.well-known/resources/did-configuration/) as required by the [KILT Credential API specification](https://github.com/KILTprotocol/spec-ext-credential-api).
160
+
This library helps set up the [Well-Known DID Configuration](https://identity.foundation/.well-known/resources/did-configuration/) as required by the [KILT Credential API specification](https://github.com/KILTprotocol/spec-ext-credential-api).
68
161
69
162
### Using the CLI Tool
70
163
71
-
A CLI tool is included in this library to create a [DID Configuration Resource](https://identity.foundation/.well-known/resources/did-configuration/#did-configuration-resource) as specified in the above documentation. This resource is necessary to establish a secure, end-to-end encrypted communication channel between a conforming browser extension and the application backend.
164
+
This library includes a CLI tool to create a [DID Configuration Resource](https://identity.foundation/.well-known/resources/did-configuration/#did-configuration-resource). This resource is necessary to establish a secure, end-to-end encrypted communication channel between a conforming browser extension and the application backend.
165
+
166
+
:::warning KILT Account
167
+
168
+
The `createDidConfig` CLI tool **only** works if you installed the package with Yarn.
169
+
170
+
:::
72
171
73
-
To start using this tool, you can add this package to your application using `yarn add --dev kilt-extension-api` or install it globally if needed (`yarn global add kilt-extension-api`).
172
+
Run the CLI toolusing Yarn as follows:
74
173
75
-
You can run the CLI tool using Yarn as follows:
174
+
<!-- TODO: More info on these -->
76
175
77
176
```bash
78
177
yarn createDidConfig --did <your DID> --origin <your domain> --assertionMethod <id of your DID's assertionMethod key> --seed <seed or mnemonic of the assertionMethod key>
79
178
```
80
179
81
-
For additional commands and configuration options, refer to the CLI tool's helper:
180
+
Use the tool's `--help` flag to see all available options:
82
181
83
182
```bash
84
183
yarn createDidConfig --help
85
184
```
86
185
87
-
### Integration into Your App
186
+
### Integration into an App
88
187
89
-
Similar functionality to the CLI tool is available forimport into your Node.js scripts using the subpath `kilt-extension-api/wellKnownDidConfiguration`:
188
+
Similar functionality to the CLI tool is available forusein application code using the `kilt-extension-api/wellKnownDidConfiguration` subpath:
90
189
91
190
```ts
92
191
import { createCredential, didConfigResourceFromCredential } from './wellKnownDidConfiguration/index.js'
0 commit comments