3. Connecting Tina Cloud


While the fully-local development workflow is the recommended way for developers to work, you'll obviously want other editors and collaborators to be able to make changes on a hosted website with authentication.

ℹī¸ Changes from the /admin route show up on your home page after your site finishes a rebuild.

Register your local application with Tina Cloud

  1. Visit auth.tinajs.dev, create an organization, and sign in. Make a note of your organization id.
  2. Create an app which connects to the GitHub repository you've just forked. Once your app is created, make a note of the client ID.

Connect your local project with Tina Cloud

In the env.local file set:

  • NEXT_PUBLIC_USE_LOCAL_CLIENT to 0.
  • NEXT_PUBLIC_REALM_NAME to your Tina Cloud realm name
  • NEXT_PUBLIC_TINA_CLIENT_ID to the Client ID displayed in your Tina Cloud App.

Restart your server and run yarn dev again.

Open http://localhost:3000/admin

This time a modal asks you to authenticate through Tina Cloud. Upon success, your edits will be commited to GitHub through Tina Cloud.

Now we're ready to host our new site!