<@U04UQ68083H> Where can I get the Ory access toke...
# ory-copilot
e
@chilly-king-10285 Where can I get the Ory access token to start working with IdentityApi?
c
A message from kapa.ai
I'm sorry, but the provided knowledge sources do not contain information on where to obtain the Ory access token for working with the Identity API. However, typically, access tokens are obtained through the authentication process of the respective service. Please refer to the official Ory documentation or support for more detailed instructions.
e
@chilly-king-10285 How should I setup IdentityApi for my next.js project?
c
A message from kapa.ai
The provided knowledge sources do not contain specific information on setting up the IdentityApi for a Next.js project. However, they do provide instructions on how to integrate Ory authentication into a Next.js application. Here are the steps: 1. Create a new Next.js project: You can create a new Next.js project using the following commands:
Copy code
npx create-next-app@latest --typescript      cd <your-project-directory>
[Source](https://www.ory.sh/docs/getting-started/integrate-auth/nextjs) 2. Install Ory's SDK and Integration Tools: Ory provides integration tools that quickly combine Ory with Next.js. Install Ory's SDK, used to make API calls to Ory, and Ory's Integration Tools for JavaScript frameworks using the following command:
Copy code
npm i --save @ory/integrations @ory/client
[Source](https://www.ory.sh/docs/getting-started/integrate-auth/nextjs#install-ory) 3. Create a special route: Create a special route in
[...paths].js
at
pages/api/.ory/
. This route connects your Next.js app with Ory's APIs and ensures that all cookies and credentials are set up. Without it, your Next.js application won't be able to talk to Ory's APIs. [Source](https://www.ory.sh/docs/getting-started/integrate-auth/nextjs#install-ory) 4. Require login to access the home page: Add a session check to the default home page of the Next.js example application to check whether the user is signed in, and redirect them to the login page if not. [Source](https://www.ory.sh/docs/getting-started/integrate-auth/nextjs#require-login-to-access-the-home-page) Please refer to the official Ory documentation for more detailed instructions on setting up the IdentityApi.