2.7.0 • Published 5 months ago
@roughapp/sdk v2.7.0
@roughapp/sdk
A TypeScript SDK for interacting with the Rough API.
Installation
npm install @roughapp/sdkAuthorization
All API requests require an Authorization header with a Bearer token. When making requests, include your API key like this:
import { client, getDocumentList } from '@roughapp/sdk'
// Option 1: use the same API key for all requests
client.setConfig({ auth: () => 'your-api-key' })
// Option 2: manually pass an API key
const response = await getDocumentList({
auth: 'your-api-key'
})Available Endpoints
Documents
// Get all documents
const documents = await getDocumentList({
query: { includeArchived: 'false' }
})
// Get a specific document
const document = await getDocument({
path: { documentId: "123" }
})Notes
getNoteList()- Get all notescreateNote()- Create a new notegetNote()- Get a specific notedeleteNote()- Delete a note
People
getPersonList()- List all peoplecreatePerson()- Create a new persongetPerson()- Get a specific persongetPersonByEmail()- Find person by emailupsertPerson()- Create or update a person
Other Resources
getWorkspace()- Get workspace detailsgetContentList()- List all contentgetLabelList()- List all labelsgetReferenceList()- List all referencesgetUserList()- List all users
OAuth2 Authentication
For OAuth2 authentication flows:
import { createRoughOAuth2Provider } from '@roughapp/sdk'
const oauth2 = createRoughOAuth2Provider({
baseUrl: 'https://in.rough.app',
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET',
redirectUri: 'YOUR_REDIRECT_URI'
})Uploading Images
import { createPendingTusUpload, uploadFile } from '@roughapp/sdk'
const result = createPendingTusUpload()
if (result.error || !result.data) { /* ... */ }
const uploadToken = result.data.token
const uploadId = await uploadFile({
uploadToken,
data: Buffer.from(...),
fileName: 'image.jpg',
mimeType: 'image/jpeg',
})For detailed API documentation and request/response types, please refer to the source code or contact Rough support.
2.7.0
5 months ago
2.6.0
5 months ago
2.5.0
5 months ago
2.4.0
9 months ago
2.3.0
10 months ago
2.2.0
10 months ago
2.1.0
10 months ago
2.0.0
10 months ago
1.2.1
10 months ago
1.2.0
10 months ago
1.1.0
10 months ago
1.0.0
10 months ago
0.5.0
10 months ago
0.4.1
10 months ago
0.4.0
10 months ago
0.3.0
10 months ago
0.2.2
10 months ago
0.2.1
10 months ago
0.2.0
10 months ago
0.1.0
10 months ago