Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@ruptjs/rupt-react-native
Advanced tools
Rupt SDK for React Native. Library for monitoring and preventing account sharing in web apps.
yarn
yarn add @ruptjs/rupt-react-native
npm
npm install @ruptjs/rupt-react-native
::
The two main ways to implement Rupt into your project:
import { RuptProvider } from "@ruptjs/rupt-react-native";
Import the RuptProvider
component to link the device to the account. You must pass the client_id
and a account
.
<RuptProvider
// required
clientId={client_id}
account={account_id}
// optional
email={user_email},
phone={user_phone},
matadata={},
callbacks={{
onSuccess,
onChallenge,
onNewAccount,
onSuspended,
onLimitExceeded,
onCurrentDeviceLogout,
}}
debug={false}
/>
By doing these two things, Rupt associates devices to accounts and detect behaviors that indicate account sharing. For more on this, see How account sharing prevention works?
First import the script (only if you installed using a package manager)
import { attach, detach } from "@ruptjs/rupt-react-native";
Call the attach
function to link the device to the account. You must pass the client_id
and a account
.
const { device_id } = await attach({
client_id: "client_id",
account: "account_id",
email: "user_email", // Optional
phone: "user_phone", // Optional
matadata: {}, // Optional
redirect_urls: {
logout_url: "https://your-logout-url.com",
new_account_url: "https://your-create-new-account-url.com",
},
});
::alert{type="tip"}
The email
and phone
are optional but strongly recommended. If you want to ask users to verify accounts before they kick out other people using their account, you should provide the email
and phone
fields.
::
Rupt will take care of the rest. If Rupt determines there's misbehavior, it will trigger a challenge. For more on this, see Challenges
By default, devices are automatically detached if they are not used for 1 week. You can change this behavior in the dashboard settings.
But you should also call the detach
function when the user logs out. This will ensure that Rupt has the most up-to-date information about the devices associated with the account. To do this, call the detach
function like so:
await detach({
client_id: `client_id`,
account: `account_id`,
device: `device_id`,
});
The device
field takes the device ID that is returned in the attach
function response as device_id
. Finally, when a detach function is called, it triggers the logout flow so the user will be redirected to the callbacks.logout_url
in the target device. Ensure that you have set the logout_url
in the redirect_urls
object when calling the attach
function. For more, see Signing the user out
FAQs
Rupt SDK for React Native
The npm package @ruptjs/rupt-react-native receives a total of 163 weekly downloads. As such, @ruptjs/rupt-react-native popularity was classified as not popular.
We found that @ruptjs/rupt-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.