https://github.com/callstackincubator/react-native-legal
Automagically generate license acknowledgements for your React Native app
https://github.com/callstackincubator/react-native-legal
acknowledgements android ios licenses react-native tvos
Last synced: about 1 month ago
JSON representation
Automagically generate license acknowledgements for your React Native app
- Host: GitHub
- URL: https://github.com/callstackincubator/react-native-legal
- Owner: callstackincubator
- License: mit
- Created: 2023-08-07T11:01:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-07T09:02:49.000Z (about 1 month ago)
- Last Synced: 2025-05-07T10:23:07.680Z (about 1 month ago)
- Topics: acknowledgements, android, ios, licenses, react-native, tvos
- Language: TypeScript
- Homepage: https://callstackincubator.github.io/react-native-legal/
- Size: 37 MB
- Stars: 196
- Watchers: 4
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# `react-native-legal`
Automagically generate license acknowledgements for your React Native app 🚀
| Android | iOS | AndroidTV | tvOS |
| - | - | - | - |
|  |  |  |  |## Installation
```sh
yarn add react-native-legal
```or
```sh
npm i --save react-native-legal
```## Usage
This tool is split into 2 parts:
- a library that lets you display native screen with a list of all dependencies and their licenses
- a [config plugin](https://docs.expo.dev/config-plugins/introduction/?redirected) (for Expo projects) and a [custom community cli plugin](https://github.com/react-native-community/cli/blob/main/docs/plugins.md) (for bare RN projects)### I want to generate licenses in my Expo project
1. Add the config plugin to the `app.json`/`app.config.js`
```diff
{
"expo": {
"plugins": [
+ "react-native-legal"
]
}
}
```2. Use the library in the codebase
```tsx
import * as React from 'react';
import { Button, View } from 'react-native';
import { ReactNativeLegal } from 'react-native-legal';function launchNotice() {
ReactNativeLegal.launchLicenseListScreen('OSS Notice');
}function MyComponent() {
return (
);
}
```3. Use [Prebuild](https://docs.expo.dev/workflow/prebuild/) or [EAS](https://docs.expo.dev/eas/) to build the app
### I want to generate licenses in my bare RN project
1. Invoke the CLI plugin from the root of your RN app
```sh
npx react-native legal-generate
```or
```sh
yarn react-native legal-generate
```2. Use the library in the codebase
```tsx
import * as React from 'react';
import { Button, View } from 'react-native';
import { ReactNativeLegal } from 'react-native-legal';function launchNotice() {
ReactNativeLegal.launchLicenseListScreen('OSS Notice');
}function MyComponent() {
return (
);
}
```## Expo
- ✅ You can use this library with [Development Builds](https://docs.expo.dev/development/introduction/) by adding `react-native-legal` to your `app.json`/`app.config.js` plugins array.
- ❌ This library can't be used in the "Expo Go" app because it [requires custom native code](https://docs.expo.dev/workflow/customizing/).## Contributing
See the [contributing guide](./CONTRIBUTING) to learn how to contribute to the repository and the development workflow.
## Acknowledgements
- [AboutLibraries](https://github.com/mikepenz/AboutLibraries) - collects and displays the license metadata for the Android app <3
- [LicensePlist](https://github.com/mono0926/LicensePlist) - generates license metadata for the iOS app <3## License
MIT