# react-native-conscent

> React native sdk for conscent

Latest version **0.3.0** (published 2020-12-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-conscent
pnpm add react-native-conscent
yarn add react-native-conscent
bun add react-native-conscent
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2020-12-29 |
| First published | 2020-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 88.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Divesh Naidu |
| Maintainers | conscent |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-conscent
- Repository: https://github.com/tsbmediaventure/conscent-native
- Homepage: https://github.com/tsbmediaventure/conscent-native.git#readme
- Issues: https://github.com/tsbmediaventure/conscent-native.git/issues
- npm.io page: https://npm.io/package/react-native-conscent

## Dependencies (1)

- [react-native-webview](https://npm.io/package/react-native-webview.md) ^11.0.2

## Recent versions

- 0.3.0 (latest) — 2020-12-29
- 0.2.2 — 2020-12-22
- 0.2.0 — 2020-12-22

## README

# react-native-conscent

This is a package written in react-native with no native code, it is a pure javascript implementation and can be used in both iOS and Android version with no extra configuration.

React-native plugin usage is covered here, complete conscent documentation is [available here.](https://tsbmediaventure.github.io/developer-docs)

## Installation

```sh
npm install react-native-conscent
```

## Usage

```js
import Conscent from 'react-native-conscent';

export default function App() {
  return (
    // When you want to render conscent's paywall, simply use the Conscent component
    <View style={{ flex: 1 }}>
      <Conscent
        clientId="your-client-id"
        storyId="your-story-id"
        successCallback={successCallback}
        subscriptionUrl="https://www.google.com"
        subscriptionCallback={subscriptioncallback}
        mode="sandbox"
      />
    </View>
  );
}
```

## Props

| Prop                 |                                                                           Definition                                                                            |
| -------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| clientId             |                                                            You get your client id from the dashboard                                                            |
| storyId              |                                                          Your storyid for a story you have registered                                                           |
| successCallback      |                        Function which will receive the success payload. See the success payload structure in the complete documentation.                        |
| subscriptionUrl      | You may either set the subscriptionUrl or the subscriptionCallback. subscriptionUrl will open the given url in the browser when the subscribe button is clicked |
| subscriptionCallback |                             function which receives no arguments. This function is called when the user clicks the subscribe button                             |
| mode                 |                                                   either 'sandbox' or 'production' based on your credentials                                                    |

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---
_Source: https://npm.io/package/react-native-conscent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
