βοΈInstallation
The SDK is available on npmjs.com or via CDN. The CDN is the preferred method of installation for any Node.js (v16+) or Browser environment.
Use the CDN
In the head
of your root HTML file, you can add the following module to access the CDN.
<script type="module" crossorigin="anonymous">
import { IDDwn } from "https://cdn.jsdelivr.net/npm/@dwn-protocol/id-sdk@latest/dist/browser.mjs";
window.IDDwn = IDDwn;
</script>
You can now reference the DWN in your JavaScript using window.IDDwn
Install the package
To install the package for Node or Browser, you can run the following command:
## If using npm:
npm i @dwn-protocol/id-sdk@latest
## If using yarn:
yarn add @dwn-protocol/id-sdk@latest
Update type declarations
If you are using Create React App or a similar technology, you can update your type declarations to include the SDK's types.
// Existing code
declare module '@dwn-protocol/id-sdk';
Last updated