Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/sweet-beds-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@clerk/clerk-expo': minor
---

This removes headers that were added for internal observability purposes. (see #2528)

```diff
- x-expo-execution-environment
- x-expo-native-application-version
```

This aims to resolve reported CORS errors. (see #2266)

This removes `expo-application` & `expo-constants` as peer and development dependencies.
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions packages/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,12 @@
"@types/node": "^20.11.24",
"@types/react": "*",
"@types/react-dom": "*",
"expo-application": "^4.2.2",
"expo-auth-session": "^5.4.0",
"expo-constants": "^14.5.1",
"expo-web-browser": "^12.8.2",
"typescript": "*"
},
"peerDependencies": {
"expo-application": ">=5",
"expo-auth-session": ">=4",
"expo-constants": ">=14",
"expo-web-browser": ">=12.5.0",
"react": ">=18",
"react-dom": ">=18"
Expand Down
9 changes: 0 additions & 9 deletions packages/expo/src/singleton.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { FapiRequestInit, FapiResponse } from '@clerk/clerk-js/dist/types/core/fapiClient';
import { Clerk } from '@clerk/clerk-js/headless';
import type { HeadlessBrowserClerk } from '@clerk/clerk-react';
import * as Application from 'expo-application';
import Constants from 'expo-constants';

import type { TokenCache } from './cache';

Expand Down Expand Up @@ -43,13 +41,6 @@ export function buildClerk({ key, tokenCache }: BuildClerkOptions): HeadlessBrow

const jwt = await getToken(KEY);
(requestInit.headers as Headers).set('authorization', jwt || '');

// Send some non-identifying headers that are useful for logging
(requestInit.headers as Headers).set('x-expo-execution-environment', Constants.executionEnvironment);
(requestInit.headers as Headers).set(
'x-expo-native-application-version',
Application.nativeApplicationVersion || 'NULL',
);
Comment on lines -47 to -52

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thiskevinwang If having this kind of information was useful, and don't wanna completely removed it, couldn't we just do this ?

if(!isValidBrowser()) {
      // Send some non-identifying headers that are useful for logging
      (requestInit.headers as Headers).set('x-expo-execution-environment', Constants.executionEnvironment);
      (requestInit.headers as Headers).set(
        'x-expo-native-application-version',
        Application.nativeApplicationVersion || 'NULL',
      );
}

of use import { Platform } from 'react-native';

if (Platform.OS !== 'web') {
      // Send some non-identifying headers that are useful for logging
      (requestInit.headers as Headers).set('x-expo-execution-environment', Constants.executionEnvironment);
      (requestInit.headers as Headers).set(
        'x-expo-native-application-version',
        Application.nativeApplicationVersion || 'NULL',
      );
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@panteliselef Oh, smart thinking! But also...

If having this kind of information was useful

...Turns out, it was not particularly useful so I'd say we just remove this!

});

// @ts-expect-error
Expand Down