// React Native - With Auth0
import { useAuth0 } from 'react-native-auth0';
import { initialize, authenticateWithJWT } from '@coinbase/cdp-core';
const { authorize, getCredentials } = useAuth0();
await initialize({
projectId: 'my-project',
customAuth: {
getJwt: async () => {
const creds = await getCredentials();
return creds?.accessToken;
}
},
ethereum: { createOnLogin: 'eoa' }
});
// User clicks sign in - triggers Auth0 login
await authorize();
// Then authenticate with CDP
const result = await authenticateWithJWT();
console.log(result.user); // Authenticated user with wallet