-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
App SDK's SanityApp
does not authenticate in a Plugin (Tool) context.
To Reproduce
- Implement App SDK into an existing Studio as a Tool, e.g.:
const MyComponent: FunctionComponent = (): ReactElement => {
const client = useClient()
const {projectId, dataset} = client.config()
const config: SanityConfig[] = [
{
projectId,
dataset,
},
]
return (
<SanityApp
config={config}
>
<MySubComponent />
</SanityApp>
);
}
export const myTool = (): Tool => {
return {
component: () => <MyComponent />,
};
}
- Try loading the Tool in any environment other than localhost (https://example.com)
- Wait for 5 seconds, the Tool will disappear and be replaced with an authentication error
Observe CORS-related failed network requests to:
- https://api.sanity.io/v2021-06-07/users/me
- https://api.sanity.io/v2025-02-19/projects/{project_id}?tag=sanity.sdk
Expected behavior
Authentication should persist and succeed. The Tool should load as it does on localhost.
Screenshots


Which versions of Sanity are you using?
v3.93.0
What operating system are you using?
Not applicable
Which versions of Node.js / npm are you running?
Not applicable
Metadata
Metadata
Assignees
Labels
No labels