Skip to content

Commit

Permalink
Merge pull request #21 from contentpass/docs-update-readme
Browse files Browse the repository at this point in the history
docs: update readme
  • Loading branch information
slawomirzaba authored Dec 4, 2024
2 parents ba72a6b + 68a1a08 commit 5d34288
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,16 @@ or improved. The SDK will then refresh and revalidate the user's authentication
```jsx
import React, { useEffect } from 'react';
import { useContentpassSdk } from 'react-native-contentpass';
import { Button, View } from 'react-native';

const YourApp = () => {
const { authenticate, registerObserver, unregisterObserver, logout, recoverFromError } = useContentpassSdk();
const {
authenticate,
registerObserver,
unregisterObserver,
logout,
recoverFromError
} = useContentpassSdk();

useEffect(() => {
const observer = (state) => {
Expand All @@ -106,7 +113,9 @@ const YourApp = () => {
}, []);

return (
<button onClick={authenticate}>Authenticate</button>
<View>
<Button onPress={authenticate} title={'Authenticate'} />
</View>
);
};
```
Expand Down

0 comments on commit 5d34288

Please sign in to comment.