Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

🏷️ Release / v1.0.0 #20

Merged
merged 4 commits into from
Jun 27, 2024
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
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ React Native SDK for Cryptr Authentication through SSO
- [@cryptr/cryptr-react-native](#cryptrcryptr-react-native)
- [Summary](#summary)
- [Expo integration](#expo-integration)
- [Install SDK and link to Expo](#install-sdk-and-link-to-expo)
- [Add plugin to handle android's manifest update](#add-plugin-to-handle-androids-manifest-update)
- [Prerequisites](#prerequisites)
- [Android](#android)
- [iOS](#ios)
Expand Down Expand Up @@ -35,7 +37,65 @@ React Native SDK for Cryptr Authentication through SSO

## Expo integration

:warning: this is not compatible with Expo Go (neither `link`) and requires a run (`expo run`)
:warning: Follow below steps to use our SDK with Expo

### Install SDK and link to Expo

```bash
npm i @cryptr/cryptr-react-native

// Expo link
(npx) expo install @cryptr/cryptr-react-native

```

### Add plugin to handle android's manifest update

1. Create a file to insert in your expo config, ex named `insertCryptrStrategyPlugin.js` with below code

```javascript
const { withAppBuildGradle } = require('@expo/config-plugins');

module.exports = function withAndroidStrategiesPlugin(config) {
return withAppBuildGradle(config, (config) => {
const targetSdkVersionLine = "targetSdkVersion rootProject.ext.targetSdkVersion";
const manifestPlaceholders = 'manifestPlaceholders = [cryptrDomain: "your-app-domain", cryptrScheme: "cryptr"]';

// Check if the manifestPlaceholders already exist
if (!config.modResults.contents.includes(manifestPlaceholders)) {
config.modResults.contents = config.modResults.contents.replace(
targetSdkVersionLine,
`${targetSdkVersionLine}\n ${manifestPlaceholders}`
);
}

return config;
});
};
```

2. add config to your expo config

Update your `app.json` file to add the above file as plugin

```json
// ./app.json
{
"expo" : {
//...
"plugins": [
//...
"./insertCryptrStrategyPlugin"
]
}
}
````

3. rebuild Expo

```bash
(npx) expo prebuild
```

## Prerequisites

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cryptr/cryptr-react-native",
"version": "0.3.2",
"version": "1.0.0",
"description": "React Native SDK for Cryptr Authentication",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
Loading