Keep bot files outside your bot process
#A Discord bot can store exported reports, uploaded attachments and JSON snapshots in a dedicated OzVault project. Its runtime can be hosted elsewhere. Files are private by default and the bot authenticates with a scoped API key.
Use the JavaScript SDK in a trusted runtime
#The SDK is included in the OzVault workspace and is not yet published on npm. Link the built package into your bot, and keep the API credential and recovery key in protected environment variables. Never put either secret in a Discord message or client bundle.
import { OzVault, decode } from '@ozvault/sdk';
const vault = new OzVault({
baseUrl: process.env.OZVAULT_API_ORIGIN,
apiKey: process.env.OZVAULT_API_KEY
});
const usage = await vault.usage();
console.log(usage.remaining);Choose storage boundaries deliberately
#Give each bot its own project or bucket and key with the minimum scopes it needs. Check quota before large exports. Treat JSON snapshots as files: OzVault's object API does not run database queries or provide concurrent row updates. Use your own database when transactional tables are required.
Clear documentation is part of the product.