Unified User Session API
Manage unified user sessions using the WebToNative JavaScript API. Synchronize authentication and user data across Android and iOS apps.
Login
window.WTN.User.login({
userId: "user_123",
name: "John Doe",
email: "john@example.com",
phone: "+1234567890",
avatar: "https://example.com/avatar.png",
token: "auth_token_here",
plan: "premium",
role: "admin",
group: "team_a",
language: "en",
meta: {
storeId: "store_456",
companyName: "Acme Inc",
department: "engineering"
},
callback: function (response) {
console.log(response.success);
},
});import { login } from "webtonative/User";
login({
userId: "user_123",
name: "John Doe",
email: "john@example.com",
phone: "+1234567890",
avatar: "https://example.com/avatar.png",
token: "auth_token_here",
plan: "premium",
role: "admin",
group: "team_a",
language: "en",
meta: {
storeId: "store_456",
companyName: "Acme Inc",
department: "engineering"
},
callback: (response) => {
console.log(response.success);
},
});Pre-defined Fields
Field
Type
Required
Consumed By
Purpose
Meta Object
Key
Type
Required
Description
Key
Type
Description
Set User Info
Key
Type
Required
Description
Key
Type
Description
Get User Info
Key
Type
Description
Logout
Using User Data in Native Components
Template
Description
Last updated