@3dverse/api
v0.8.5
Published
3dverse web API. https://docs.3dverse.dev/api/
Downloads
1,029
Readme
3dverse API library
Wrapper library for the 3dverse REST API: https://docs.3dverse.com/api/.
Usage
Install
npm i @3dverse/api
Import
import * as api3dverse from '@3dverse/api';
or
import { registerUser } from '@3dverse/api';
Authentication
Only use the API key on the server.
import { setApiKey, registerUser } from '@3dverse/api';
setApiKey(MY_3DVERSE_API_KEY);
async () => {
const { user_id } = await registerUser({ username: 'my_username' });
}
For client-side request, you can authenticate with the User Token.
import { setUserToken, uploadSourceFiles } from '@3dverse/api';
setUserToken(MY_USER_TOKEN);
async () => {
const upload = await uploadSourceFiles({
folder_id: 'my_folder_id',
body: formData
});
}