Function: useApollo()
typescript
1
useApollo(): Apollo
Defined in: hooks/index.ts:49
Creates and returns a memoized instance of Apollo DID resolver.
Apollo is the DID resolver component of the Identus SDK that handles resolving Decentralized Identifiers (DIDs) to their corresponding DID Documents.
Returns
A memoized Apollo instance for DID resolution
Example
tsx1234567891011121314151617181920import { useApollo } from '@trust0/identus-react/hooks';function DIDResolver() {const apollo = useApollo();const resolveDID = async (didString: string) => {try {const didDocument = await apollo.resolveDID(didString);console.log('Resolved DID Document:', didDocument);} catch (error) {console.error('Failed to resolve DID:', error);}};return (<button onClick={() => resolveDID('did:prism:example')}>Resolve DID</button>);}