AI can be a powerful tool for developers. We’ve set up Dynamic to seamlessly integrate with your AI assisted coding workflow. Here’s are the different methods you can use to integrate Dynamic into your AI assisted coding workflow:

Cursor, Windsurf, etc.

You can use the create-dynamic-app CLI to create a new project with Dynamic already integrated. You can then use this project as a starting point, along with any other instructions.

Below we’ve given full commands to avoid the interaction with the CLI, but if you want to use the CLI, you can do so by running the following command:

npx create-dynamic-app@latest

V0, Lovable, etc.

You can one-shot an example implementation using a direct prompt. Simply start your prompt with what kind of app you want to build, and then based on the tech stack you want, copy one of the snippets below and paste it in as part of your initial prompt.

It’s also helpful to provide troubleshooting tips, see the Troubleshooting section below for more details.

Provide docs as extra context

In addition to the above, you can and should provide extra context to the AI tool you’re using (Cursor, Windsurf, V0, Lovable, etc.) by giving them docs specific to what you’re building. There are a few ways to do this:

Simply follow this tutorial to add Dynamic’s docs to Cursor, which you can then use as context in a request, just like any other file.

Troubleshooting & Guardrails

We also have a general prompt/guide for LLMs that you can use to can use to stop them going off track, and to teach them how to handle common errors/issues. Paste this into your prompt editor of choice either as part of your initial prompt, or when it gets stuck.

# Troublingshooting your Dynamic.xyz implementation

## Common errors and how to fix them

### Error: "XXXX must be used within a DynamicContextProvider"

This error means that you have used a Dynamic component/hook, but the component it's used in, is not inside the tree that is wrapped by the DynamicContextProvider.

### Error: "You are missing the environmentId field in yours DynamicContextProvider settings prop"

This error means that the environment ID is not set in the DynamicContextProvider settings prop. It's required, ask the user for it, or try the public default (f0b977d0-b712-49f1-af89-2a24c47674da).

### Error: Anything related to CORS

There is a good chance that the user has not added their URL to the CORS whitelist. Ask them to add it via https://app.dynamic.xyz/dashboard/security#cors, and then try again, it can take a few minutes to take effect.

### Anything else
Please check you are only using the current documentation, the md of which can be found [here](https://dynamic.xyz/docs/llms-full.txt).

AI can be a powerful tool for developers. We’ve set up Dynamic to seamlessly integrate with your AI assisted coding workflow. Here’s are the different methods you can use to integrate Dynamic into your AI assisted coding workflow:

Cursor, Windsurf, etc.

You can use the create-dynamic-app CLI to create a new project with Dynamic already integrated. You can then use this project as a starting point, along with any other instructions.

Below we’ve given full commands to avoid the interaction with the CLI, but if you want to use the CLI, you can do so by running the following command:

npx create-dynamic-app@latest

V0, Lovable, etc.

You can one-shot an example implementation using a direct prompt. Simply start your prompt with what kind of app you want to build, and then based on the tech stack you want, copy one of the snippets below and paste it in as part of your initial prompt.

It’s also helpful to provide troubleshooting tips, see the Troubleshooting section below for more details.

Provide docs as extra context

In addition to the above, you can and should provide extra context to the AI tool you’re using (Cursor, Windsurf, V0, Lovable, etc.) by giving them docs specific to what you’re building. There are a few ways to do this:

Simply follow this tutorial to add Dynamic’s docs to Cursor, which you can then use as context in a request, just like any other file.

Troubleshooting & Guardrails

We also have a general prompt/guide for LLMs that you can use to can use to stop them going off track, and to teach them how to handle common errors/issues. Paste this into your prompt editor of choice either as part of your initial prompt, or when it gets stuck.

# Troublingshooting your Dynamic.xyz implementation

## Common errors and how to fix them

### Error: "XXXX must be used within a DynamicContextProvider"

This error means that you have used a Dynamic component/hook, but the component it's used in, is not inside the tree that is wrapped by the DynamicContextProvider.

### Error: "You are missing the environmentId field in yours DynamicContextProvider settings prop"

This error means that the environment ID is not set in the DynamicContextProvider settings prop. It's required, ask the user for it, or try the public default (f0b977d0-b712-49f1-af89-2a24c47674da).

### Error: Anything related to CORS

There is a good chance that the user has not added their URL to the CORS whitelist. Ask them to add it via https://app.dynamic.xyz/dashboard/security#cors, and then try again, it can take a few minutes to take effect.

### Anything else
Please check you are only using the current documentation, the md of which can be found [here](https://dynamic.xyz/docs/llms-full.txt).