Variable: PrismDIDContext
typescript
1
const PrismDIDContext: Context<undefined | { create: (alias) => Promise<DID>; isPublished: (did) => Promise<boolean>; prismDID: null | DID; }>
Defined in: packages/identus-react/src/context/index.ts:58
React context for managing Prism DID operations and state.
Prism DIDs are long-lived, blockchain-anchored identifiers that provide persistent, verifiable identity on the Cardano network. This context manages the creation and state of Prism DIDs within the application.
Example
tsx1234567891011121314151617181920212223242526import { PrismDIDContext } from '@trust0/identus-react/context';import { useContext } from 'react';function PrismDIDManager() {const context = useContext(PrismDIDContext);if (!context) {throw new Error('PrismDIDManager must be used within PrismDIDProvider');}const { prismDID, create } = context;const handleCreateDID = async () => {await create('my-main-identity');};return (<div>{prismDID ? (<p>Prism DID: {prismDID.toString()}</p>) : (<button onClick={handleCreateDID}>Create Prism DID</button>)}</div>);}