https://github.com/mirego/react-native-killswitch
The official React Native implementation of Mirego’s killswitch
https://github.com/mirego/react-native-killswitch
killswitch react-native
Last synced: 6 months ago
JSON representation
The official React Native implementation of Mirego’s killswitch
- Host: GitHub
- URL: https://github.com/mirego/react-native-killswitch
- Owner: mirego
- License: bsd-3-clause
- Created: 2023-03-21T15:03:17.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-25T17:33:32.000Z (over 1 year ago)
- Last Synced: 2025-07-26T18:39:52.526Z (6 months ago)
- Topics: killswitch, react-native
- Language: TypeScript
- Homepage: https://open.mirego.com
- Size: 618 KB
- Stars: 5
- Watchers: 22
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
React Native Killswitch is a library built by Mirego that allows mobile developers to apply
runtime version-specific behaviors to their React Native application.
## What is Killswitch?
[Killswitch is a clever control panel](https://github.com/mirego/killswitch) built by Mirego that allows mobile developers to apply runtime version-specific behaviors to their iOS or Android application.
## Installation
```sh
npm install react-native-killswitch
```
## Usage
The bare minimum needed to have a working killswitch is API keys for iOS and Android,
the app language and the app version:
```js
import { useKillswitch } from 'react-native-killswitch';
const { isOk } = useKillswitch({
iosApiKey: iosApiKey,
androidApiKey: androidApiKey,
language: myAppLanguage,
version: myAppVersion,
});
```
### Options
- `iosApiKey`
A string taken from your killswitch back-end. The killswitch back-end will use
this to send the correct behavior to your iOS users.
- `androidApiKey`
A string taken from your killswitch back-end. The killswitch back-end will use
this to send the correct behavior to your Android users.
- `language`
A language code like "en" or "de". The killswitch back-end will use this to
send a localized message to your users.
- `version`
A version number like "1.0.0". The killswitch back-end will use this to send
the correct behavior to your users.
- `apiHost`
The host of the killswitch back-end.
- `useNativeUI`
Use native alerts to display messages. Defaults to `true`
- `timeout`
A number of milliseconds to wait for the back-end before returning `isOk = true`. Defaults to `2000`
## License
react-native-killswitch is © 2023 [Mirego](https://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](./LICENSE.md) file.
The shield logo is based on [this lovely icon by Kimmi Studio](https://thenounproject.com/icon/shield-1055246/), from The Noun Project. Used under a [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/) license.
## About Mirego
[Mirego](https://www.mirego.com) is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of [talented people](https://life.mirego.com) who imagine and build beautiful Web and mobile applications. We come together to share ideas and [change the world](http://www.mirego.org).
We also [love open-source software](https://open.mirego.com) and we try to give back to the community as much as we can.