<@U04UQ68083H> how to configure ory client in angu...
# ory-copilot
e
@chilly-king-10285 how to configure ory client in angularjs
c
A message from kapa.ai
I'm sorry, but the provided knowledge sources do not contain specific information on how to configure the Ory client in AngularJS. However, they do provide examples of how to configure the Ory client in other languages and frameworks, which might be helpful as a reference. For instance, in the context of a Single-Page App (SPA) like an AngularJS application, you need to configure your AJAX request to include cookies, because AJAX doesn't send cookies by default. When using the browser's
fetch
function, you need to set
credentials: 'include'
. This is necessary when you want the application to access the Ory Identities Public API. [Source](https://www.ory.sh/docs/troubleshooting/csrf#accessing-apis-from-client-side-javascript--ajax) In terms of configuring the Ory client, the knowledge sources provide examples in TypeScript, which is a superset of JavaScript and might be somewhat applicable to AngularJS. Here's an example:
Copy code
typescript import { Configuration, OAuth2Api } from "@ory/client"      const ory = new OAuth2Api(     new Configuration({       basePath: `https://${process.env.ORY_PROJECT_SLUG}.<http://projects.oryapis.com|projects.oryapis.com>`,       accessToken: process.env.ORY_API_KEY,     }),   )
[Source](https://www.ory.sh/docs/hydra/guides/client-token-expiration#lifespan-configuration-for-specific-clients) Please note that you would need to adapt this to your AngularJS context and the specific Ory APIs you are using. For more detailed information, I would recommend referring to the official Ory documentation or the AngularJS documentation.