billowy-magician-58884
08/15/2025, 3:58 PMbrief-egg-61061
08/15/2025, 3:58 PMbrief-egg-61061
08/15/2025, 3:58 PM<http://localhost:3000>
. 3. Start the Ory Tunnel In a new terminal, run the Ory Tunnel, pointing it to your local app and your Ory project: ory tunnel --dev --project <project-id-or-slug> <http://localhost:3000>
This will start the tunnel on port 4000 by default. The --dev
flag disables some security checks for easier local development. Now, Ory APIs are available at <http://localhost:4000>
and your app at `http://localhost:3000`<br> [Ory Tunnel documentation](https://www.ory.sh/docs/cli/ory-tunnel#ory-tunnel) [Local development guide](https://www.ory.sh/docs/getting-started/local-development#local-development) 4. Configure your SDK or API calls In your custom UI, configure the Ory SDK or any direct API calls to use <http://localhost:4000>
as the Ory API base URL, not the remote Ory Cloud URL. Example (Node.js): js import { Configuration, FrontendApi } from "@ory/client-fetch" const ory = new FrontendApi( new Configuration({ basePath: "<http://localhost:4000>", }), )
[SDK configuration example](https://www.ory.sh/docs/identities/get-started/setup) 5. Test your flows Open your app at <http://localhost:3000>
and interact with your custom UI. All authentication and identity flows will be proxied through the tunnel, using your Ory Cloud project. Notes: - Always use localhost
consistently (not 127.0.0.1
) to avoid cookie issues. - The Ory Tunnel is for development only. For production, configure a custom domain in your Ory project. - If you encounter CORS issues, the tunnel resolves them by mirroring Ory APIs on the same domain as your app. For more details, see the [Bring-your-own-UI integration basics](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#debug) and [Configure Ory to use your UI](https://www.ory.sh/docs/kratos/bring-your-own-ui/configure-ory-to-use-your-ui#development) guides.