WEB4 JS SDK
Full module reference for @oasisomniverse/web4-api — the isomorphic JavaScript SDK for the OASIS WEB4 API. Works in Node 18+ and all modern browsers.
Installation
terminal
npm install @oasisomniverse/web4-api
Initialisation
javascript
import OASIS from '@oasisomniverse/web4-api'; const oasis = new OASIS({ baseUrl: 'https://api.oasisomniverse.one', // or your ONODE URL token: 'your-jwt-token' // set after authenticate() });
Auth Module — oasis.auth
- auth.register(params)Register a new avatar. Returns
{ result, isError, message }. - auth.authenticate(params)Authenticate and receive a JWT token. Sets
oasis.tokenautomatically on success. - auth.forgotPassword(email)Send password-reset email.
- auth.resetPassword(params)Reset password using the emailed token.
Avatar Module — oasis.avatar
- avatar.get(id)Fetch a single avatar by ID.
- avatar.getAll()Fetch all avatars. Admin only.
- avatar.update(id, params)Update avatar fields.
- avatar.delete(id)Soft-delete avatar. Admin only.
- avatar.search(query)Search avatars by username, email or title.
Karma Module — oasis.karma
- karma.addKarmaToAvatar(params)Award karma. See Karma API for params.
- karma.removeKarmaFromAvatar(params)Deduct karma.
- karma.getKarmaForAvatar(id)Full karma history and total.
Data Module — oasis.data
- data.saveHolon(holon, providerType?)Persist a holon object. Provider optional.
- data.loadHolon(id, providerType?)Load a holon by ID.
- data.deleteHolon(id, providerType?)Delete a holon.
- data.searchHolons(query)Full-text search across holons.
NFT & Wallet Module — oasis.nft
- nft.mintNFT(params)Mint a new NFT on the configured chain.
- nft.transferNFT(params)Transfer an NFT between avatars.
- nft.getNFTsForAvatar(id)List all NFTs owned by an avatar.
- nft.getBalance(id, chainType?)Get wallet balance across chains.
Map Module — oasis.map
- map.getSpawn()Get global spawn point data for Our World map.
- map.getGeoHotSpots()Retrieve active geospatial hotspots.
- map.getGeoNFTs()Retrieve geolocated NFTs.
HyperDrive Module — oasis.hyperdrive
- hyperdrive.getProviderHealth()Get health scores for all registered providers.
- hyperdrive.setDefaultProvider(providerType)Change the default provider at runtime.
- hyperdrive.replicateToProvider(targetType)Trigger a manual replication to a provider.
WEB5 API
@oasisomniverse/web5-api extends WEB4 with Celestial Spaces, GeoNFTs, holonic memory, and cosmic-scale features. See WEB5 SDK reference.