Before this: create a Dynamic client (see Creating a Dynamic Client). By default, the Dynamic Client will be automatically initialized when you create it, but if you wish to manually initialize the client, you can setDocumentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
autoInitialize to false and then call initializeClient manually.
You can wait until the client is ready by listening for initStatusChanged with status 'finished' (see onEvent), or by using the waitForClientInitialized helper function.
Waiting for initialization
ThewaitForClientInitialized function returns a promise that resolves when the client has finished initializing. This is useful when you need to ensure the client is ready before performing operations.
- JavaScript
- React
Usage
Manual initialization uses the samecreateDynamicClient and initializeClient flow in React and plain JavaScript (typically in a client module that runs once, e.g. dynamicClient.ts).
Client init status events
You can listen to theinitStatusChanged event using the onEvent method.
Listening to the client init status changes
useInitStatus for components that need to respond to init state, or useEvent if you need the raw initStatusChanged payload in a hook-friendly way.
Available statuses
'uninitialized'- The client initialization has not started yet.'in-progress'- The client initialization is in progress.'finished'- The client initialization has finished.'failed'- The client initialization has failed.