react-native-more-sso
v0.2.5
Published
To track the mobile app events
Readme
📦 React Native More SSO
A lightweight SDK to easily integrate SSO (Single Sign-On) authentication into your React Native applications with a ready-to-use authentication UI.
🚀 Installation
npm install react-native-more-sso
# or
yarn add react-native-more-sso🛠️ Initialization
Initialize the SDK before rendering any authentication components:
import { SSOAuthorization } from 'react-native-more-sso';
SSOAuthorization.init({
idp: 'https://api.sso.dev.more.in/',
app: 'app_name',
});| Option | Type | Required | Description |
| ------ | -------- | -------- | ------------------------------------ |
| idp | string | ✔️ | Identity Provider base URL |
| app | string | ✔️ | Application name registered with SSO |
🔐 Login Component
import { LoginForm } from 'react-native-more-sso';
const LoginScreen = () => {
const onLoginSuccess = (userData) => {
console.log('Logged In:', userData);
};
return <LoginForm onLoginSuccess={onLoginSuccess} />;
};
export default LoginScreen;| Prop | Type | Required | Description |
| ---------------- | ---------- | -------- | -------------------------------- |
| onLoginSuccess | function | ✔️ | Invoked with logged-in user data |
🔁 Refresh Token
Use getToken() to fetch a new token when the current one expires:
SSOAuthorization.getToken()
.then((token) => {
if (token) {
setAccessToken(token);
}
})
.catch((error) => console.error(error));✔️ Recommended when making API calls after session timeout
✔️ Returns the latest valid access token (if available)
🚪 Logout
Log the user out and clear session:
SSOAuthorization.logout();Call this when the user explicitly logs out of the app.
📄 License
MIT © 2025 — More Retail / Karthik
