Permadata Documentation
Technical documentation for implementing and using Permadata to ensure your data persists across sessions and devices.
Getting Started
Creating Your Account
To get started with Permadata, you'll need to create an account. This allows you to access the free tier immediately and upgrade to premium features when needed.
- Visit the signup page
- Enter your email address and create a password
- Verify your email address by clicking the link sent to your inbox
- Complete your profile setup
- Generate your API key from the dashboard
Setting Up the Free Tier
The free tier of Permadata provides local persistence for your data, ensuring it remains available across browser sessions on the same device, even if the browser is closed or restarted.
Free Tier Limitations:
- Local data persistence only (single device)
- Up to 5MB of storage
- 30-day data retention
- Basic data recovery via bookmark URL token
- No cross-device syncing
To implement Permadata in your application, include our script and initialize it with your API key:
<script src="https://cdn.permadata.bajawell.com/permadata.js"></script>
<script>
Permadata.init({
apiKey: 'YOUR_API_KEY',
storageType: 'local',
recoveryOptions: {
enableUrlToken: true,
tokenExpiration: 30 // days
}
});
</script>Upgrading to Premium
Premium tiers offer enhanced features like cloud syncing, cross-device support, and extended data retention.
To upgrade your account:
- Log in to your Permadata account
- Navigate to Account Settings > Subscription
- Select your desired plan (Basic, Pro, or Enterprise)
- Complete the payment process
- Update your implementation code to enable cloud features
After upgrading, update your initialization code to enable cloud syncing:
Permadata.init({
apiKey: 'YOUR_API_KEY',
storageType: 'cloud',
syncOptions: {
autoSync: true,
syncInterval: 60, // seconds
conflictResolution: 'server-wins'
}
});Feature Guides
Cloud Syncing
Premium users can enable cloud syncing to ensure their data is securely stored and available across multiple devices. This feature automatically syncs your data to our secure cloud servers.
Enabling Cloud Syncing:
- Upgrade to a premium plan
- Navigate to your account settings
- Enable the "Cloud Sync" option
- Choose which data types to sync
Configure sync intervals and conflict resolution in your initialization code:
Permadata.init({
apiKey: 'YOUR_API_KEY',
storageType: 'cloud',
syncOptions: {
autoSync: true,
syncInterval: 60, // seconds between sync attempts
conflictResolution: 'server-wins', // or 'client-wins', 'last-modified'
offlineSupport: true,
maxOfflineAge: 7 // days to keep offline changes
}
});Handling Sync Conflicts:
When the same data is modified on multiple devices, conflicts can occur. Permadata offers three conflict resolution strategies:
- server-wins: Cloud data takes precedence over local changes
- client-wins: Local changes override cloud data
- last-modified: The most recently modified version is kept
Cross-Device Support
With cross-device support, your data is available on any device where you sign in to your Permadata account. This feature works in conjunction with cloud syncing.
Linking a Session via Email:
- Click "Link Session" in your application
- Enter your email address
- Click the verification link sent to your email
- Your session is now linked to your account
To implement session linking in your application:
// Add a button or link in your UI
<button onclick="linkSession()">Link This Session</button>
<script>
function linkSession() {
Permadata.linkSession({
onSuccess: () => {
alert('Session linked successfully!');
},
onError: (error) => {
console.error('Error linking session:', error);
}
});
}
</script>Recovering Data on a New Device:
To access your data on a new device:
- Install your application on the new device
- Sign in with your Permadata account
- Your data will automatically sync from the cloud
- For free tier users, use the bookmark URL token to recover data
Data Recovery
Permadata offers multiple methods for data recovery, depending on your subscription tier.
Using the Bookmark URL Token (Free Tier):
Free tier users can recover data using a bookmark URL token:
- Enable URL token recovery in your initialization
- Bookmark the page with the token parameter
- If browser data is cleared, use the bookmark to restore
Important: If all tabs are closed and browser data is cleared, recovery may not be possible for free tier users.
Premium Recovery Options:
Premium users have additional recovery options:
- Cloud Backup: Data is automatically backed up to the cloud
- Version History: Access previous versions of your data
- Account Recovery: Restore data by signing in to your account
- Recovery API: Programmatically recover data
Managing Your Subscription
You can manage your Permadata subscription at any time through your account settings.
Subscription Management Options:
- Upgrade Plan: Access more storage and features
- Downgrade Plan: Reduce costs (data limits will apply)
- Update Payment: Change your payment method
- Billing History: View past invoices
- Cancel Subscription: Revert to free tier
Effects of Cancellation:
If you cancel your premium subscription:
- Your account reverts to the free tier at the end of the billing period
- Cloud-synced data remains available for 30 days
- Data exceeding free tier limits will be inaccessible
- Cross-device syncing will be disabled
API Usage
Permadata offers a comprehensive REST API for developers who need programmatic access to their data and account features.
Authentication
All API requests require authentication using your API key. Include your API key in the request headers:
// API Key Authentication
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}Sync Session Endpoint
The /api/sync-session endpoint allows you to synchronize data between devices:
Request:
POST /api/sync-session
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
body: {
"sessionId": "user_session_123",
"data": {
"preferences": { ... },
"userState": { ... }
},
"lastSyncTimestamp": 1634567890123
}Response:
{
"success": true,
"syncTimestamp": 1634567990123,
"data": {
"preferences": { ... },
"userState": { ... }
},
"conflicts": []
}Check Subscription Endpoint
The /api/check-subscription endpoint allows you to verify a user's subscription status:
Request:
GET /api/check-subscription?userId=user_123
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}Response:
{
"success": true,
"subscription": {
"tier": "pro",
"status": "active",
"expiresAt": "2023-12-31T23:59:59Z",
"features": {
"cloudSync": true,
"crossDevice": true,
"storageLimit": 500000000
}
}
}Get Cached Anonymous ID Endpoint
The /api/get-cached-anon-id endpoint retrieves a cached anonymous user ID:
Request:
GET /api/get-cached-anon-id?token=recovery_token_xyz
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}Response:
{
"success": true,
"anonymousId": "anon_user_456",
"expiresAt": "2023-11-15T12:00:00Z"
}Frequently Asked Questions
What happens if I clear my browser data?
For free tier users, clearing browser data (cookies, local storage) will remove your locally stored Permadata information. If you have a bookmark with the recovery token URL, you can use it to restore your data. Without a recovery token, your data may be permanently lost.
For premium users, your data is stored in the cloud. After clearing browser data, simply sign in to your account to restore your data on that device.
How do I recover my data if I didn't link my session?
If you're using the free tier and didn't link your session or save a recovery token bookmark, recovery options are limited. You may be able to recover data if:
- You still have at least one tab open with your application
- You're using a browser that isolates cookie clearing from local storage
- You have a device backup that includes browser data
To prevent data loss, we strongly recommend upgrading to a premium plan or at minimum using the recovery token feature.
What are the security measures for cloud syncing?
Permadata implements multiple layers of security for cloud-synced data:
- Encryption: All data is encrypted at rest using AES-256 encryption
- TLS: Data in transit is protected using TLS 1.3
- Access Controls: Strict authentication and authorization checks
- Regular Audits: Security systems are regularly audited and tested
- Data Isolation: Your data is logically isolated from other users
What happens to my data if I downgrade to the free tier?
When you downgrade from a premium plan to the free tier:
- Your cloud-synced data remains available for 30 days
- During this period, you can download your data to local storage
- After 30 days, cloud data exceeding free tier limits becomes inaccessible
- Cross-device syncing is disabled immediately
- Your local data on the current device remains intact
We recommend downloading any important data to your local device before the 30-day period expires.
Can I use Permadata in my mobile app?
Yes, Permadata offers SDKs for iOS and Android applications, as well as a REST API for custom integrations. Our mobile SDKs provide the same features as our web library, including offline support and automatic syncing.
Mobile implementation examples are available in our mobile documentation.
Troubleshooting
Sync Failures
If you're experiencing sync failures, try these troubleshooting steps:
- Check your internet connection
- Verify your API key is valid and has the correct permissions
- Ensure you haven't exceeded your storage quota
- Check the browser console for specific error messages
- Try manually triggering a sync with
Permadata.sync()
If problems persist, check our status page for any service disruptions.
Data Not Restoring After Clearing
If your data isn't restoring after clearing browser data:
- Ensure you're using the correct recovery token URL
- Check that the token hasn't expired (default is 30 days)
- Verify you're signed in with the correct account (premium users)
- Try accessing from a different browser to rule out browser-specific issues
Note: Free tier users without a recovery token may not be able to recover data if all tabs were closed before clearing browser data.
Tab Pausing Affecting Sync
Modern browsers may pause inactive tabs to conserve resources, which can affect Permadata's sync functionality:
- Sync operations may be delayed when tabs are inactive
- Background tabs may not receive real-time updates
- Sync intervals may be extended by the browser
To mitigate these issues:
- Implement manual sync triggers for critical operations
- Use the
visibilitychangeevent to sync when tabs become active - Consider using service workers for premium implementations
Storage Quota Exceeded
If you receive "Storage quota exceeded" errors:
- Review your data usage in the dashboard
- Remove unnecessary data
- Implement data compression if possible
- Consider upgrading to a higher tier with more storage
You can check your current storage usage with:
Permadata.getStorageUsage().then(usage => {
console.log('Current usage:', usage.current);
console.log('Limit:', usage.limit);
console.log('Percentage used:', usage.percentUsed);
});