Skip to content

Commit

Permalink
chore: add README
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed Feb 17, 2024
1 parent 4e59e55 commit d0a4072
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<p align="center">
<a href="https://logto.io" target="_blank" align="center" alt="Logto Logo">
<img src="./logo.png" height="120">
</a>
</p>

# Logto React Native

[![Discord](https://img.shields.io/discord/965845662535147551?logo=discord&logoColor=ffffff&color=7389D8&cacheSeconds=600)](https://discord.gg/UEPaF3j5e6)
[![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)

The monorepo for Logto React Native (Expo) SDK and sample.

- [@logto/rn](./packages/rn) - Logto React Native SDK
- [@logto/rn-sample](./packages/rn-sample) - Sample app using Logto React Native SDK

## Resources

- [📖 Logto docs](https://docs.logto.io/?utm_source=github&utm_medium=repo_logto)
- [✍️ Blog](https://blog.logto.io/?utm_source=github&utm_medium=repo_logto)
6 changes: 4 additions & 2 deletions packages/rn-sample/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { Button, StyleSheet, Text, View } from 'react-native';

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

const Content = () => {
const { signIn, signOut, client, isAuthenticated, getIdTokenClaims } = useLogto();
Expand Down Expand Up @@ -50,8 +52,8 @@ const App = () => {
return (
<LogtoProvider
config={{
endpoint: 'https://<your-logto-endpoint>',
appId: '<your-app-id>',
endpoint,
appId,
}}
>
<Content />
Expand Down
15 changes: 15 additions & 0 deletions packages/rn-sample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Logto React Native (Expo) sample

This is the sample app using [Logto React Native SDK](../rn/) with [Expo](https://expo.dev/) managed workflow.

## Get started

Replace the following parameters in `App.tsx` with your Logto project's values:

```ts
const redirectUri = 'io.logto://callback';
const endpoint = 'https://<your-logto-endpoint>';
const appId = '<your-app-id>';
```

Then run the app for development.
29 changes: 29 additions & 0 deletions packages/rn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Logto React Native SDK

The Logto JavaScript Core SDK written in TypeScript. Check out our [docs](https://docs.logto.io/sdk/react-native/) for more information.

## Installation

### Using npm

```bash
npm install @logto/rn
```

### Using yarn

```bash
yarn add @logto/rn
```

### Using pnpm

```bash
pnpm add @logto/rn
```

## Resources

[![Website](https://img.shields.io/badge/website-logto.io-8262F8.svg)](https://logto.io/)
[![Docs](https://img.shields.io/badge/docs-logto.io-green.svg)](https://docs.logto.io/)
[![Discord](https://img.shields.io/discord/965845662535147551?logo=discord&logoColor=ffffff&color=7389D8&cacheSeconds=600)](https://discord.gg/UEPaF3j5e6)

0 comments on commit d0a4072

Please sign in to comment.