Skip to content

Commit d0a4072

Browse files
committed
chore: add README
1 parent 4e59e55 commit d0a4072

File tree

4 files changed

+68
-2
lines changed

4 files changed

+68
-2
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<p align="center">
2+
<a href="https://logto.io" target="_blank" align="center" alt="Logto Logo">
3+
<img src="./logo.png" height="120">
4+
</a>
5+
</p>
6+
7+
# Logto React Native
8+
9+
[![Discord](https://img.shields.io/discord/965845662535147551?logo=discord&logoColor=ffffff&color=7389D8&cacheSeconds=600)](https://discord.gg/UEPaF3j5e6)
10+
[![Build Status](https://github.com/logto-io/react-native/actions/workflows/main.yml/badge.svg)](https://github.com/logto-io/react-native/actions/workflows/main.yml)
11+
12+
The monorepo for Logto React Native (Expo) SDK and sample.
13+
14+
- [@logto/rn](./packages/rn) - Logto React Native SDK
15+
- [@logto/rn-sample](./packages/rn-sample) - Sample app using Logto React Native SDK
16+
17+
## Resources
18+
19+
- [📖 Logto docs](https://docs.logto.io/?utm_source=github&utm_medium=repo_logto)
20+
- [✍️ Blog](https://blog.logto.io/?utm_source=github&utm_medium=repo_logto)

packages/rn-sample/App.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { Button, StyleSheet, Text, View } from 'react-native';
88

99
// Replace with your own redirect URI
1010
const redirectUri = 'io.logto://callback';
11+
const endpoint = 'https://<your-logto-endpoint>';
12+
const appId = '<your-app-id>';
1113

1214
const Content = () => {
1315
const { signIn, signOut, client, isAuthenticated, getIdTokenClaims } = useLogto();
@@ -50,8 +52,8 @@ const App = () => {
5052
return (
5153
<LogtoProvider
5254
config={{
53-
endpoint: 'https://<your-logto-endpoint>',
54-
appId: '<your-app-id>',
55+
endpoint,
56+
appId,
5557
}}
5658
>
5759
<Content />

packages/rn-sample/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Logto React Native (Expo) sample
2+
3+
This is the sample app using [Logto React Native SDK](../rn/) with [Expo](https://expo.dev/) managed workflow.
4+
5+
## Get started
6+
7+
Replace the following parameters in `App.tsx` with your Logto project's values:
8+
9+
```ts
10+
const redirectUri = 'io.logto://callback';
11+
const endpoint = 'https://<your-logto-endpoint>';
12+
const appId = '<your-app-id>';
13+
```
14+
15+
Then run the app for development.

packages/rn/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logto React Native SDK
2+
3+
The Logto JavaScript Core SDK written in TypeScript. Check out our [docs](https://docs.logto.io/sdk/react-native/) for more information.
4+
5+
## Installation
6+
7+
### Using npm
8+
9+
```bash
10+
npm install @logto/rn
11+
```
12+
13+
### Using yarn
14+
15+
```bash
16+
yarn add @logto/rn
17+
```
18+
19+
### Using pnpm
20+
21+
```bash
22+
pnpm add @logto/rn
23+
```
24+
25+
## Resources
26+
27+
[![Website](https://img.shields.io/badge/website-logto.io-8262F8.svg)](https://logto.io/)
28+
[![Docs](https://img.shields.io/badge/docs-logto.io-green.svg)](https://docs.logto.io/)
29+
[![Discord](https://img.shields.io/discord/965845662535147551?logo=discord&logoColor=ffffff&color=7389D8&cacheSeconds=600)](https://discord.gg/UEPaF3j5e6)

0 commit comments

Comments
 (0)