Custom persistence provider
Replace PlayerPrefs session storage with a cloud backend, encrypted file store, or in-memory implementation by implementing IKeyValueStore or IPersistenceProvider.
What the SDK writes to storage
Key prefix
Contents
Why it matters
Persistence interfaces
IKeyValueStore — simple storage
namespace Convai.Domain.Abstractions
{
public interface IKeyValueStore
{
string GetString(string key, string defaultValue = null);
void SetString(string key, string value);
bool HasKey(string key);
void DeleteKey(string key);
void Save();
}
}IPersistenceProvider — full-featured storage
Scenario
Implement
Supporting types
PersistenceResult
Member
Type
Description
ConflictResolutionStrategy
Value
Behavior
PersistenceOptions
Implementation examples
In-memory store (testing / CI)
Encrypted file store
Adapter pattern for IKeyValueStore implementations
Register the provider
Troubleshooting
Symptom
Likely cause
Fix
Next steps
Credentials, identity, and storageRuntime module systemImplement a custom moduleLast updated
Was this helpful?