Orbit API helper library for Node.js.
This client can create, read, update and delete members and identities in your Orbit workspace.
npm install @orbit-love/members
const OrbitMembers = require('@orbit-love/members')
const orbitMembers = new OrbitMembers(orbitWorkspaceId, orbitApiKey)
orbitWorkspaceId
- The part of your Orbit workspace URL that immediately follows the app.orbit.love. For example, if the URL was https://app.orbit.love/my-workspace, then your Orbit workspace ID is my-workspace.orbitApiKey
- This can be found in you Orbit Account Settings.
If you have the environment variables ORBIT_WORKSPACE_ID
and ORBIT_API_KEY
set, you can initialize the client like so:
const OrbitMembers = require('@orbit-love/members')
const orbitMembers = new OrbitMembers()
If you have environment variables set and also pass in values, the passed in values will be used.
- Information about Orbit API Rate Limiting
- For list methods, you can ask request a number of results per request between 1 and 100.
listMembers(query)
const query = {
page: 1,
items: 50,
company: 'ACME Corp'
}
orbitMembers.listMembers(query).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})
options
is not a required parameter, but can include any query parameter shown in our API reference.
getMember(memberId)
const memberId = 'janesmith04'
getMember(memberId).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})
findMember(query)
const query = {
source: 'youtube',
username: 'janesmith1990'
}
orbitMembers.findMember(query).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})
Provide a source and one of username/uid/email params to return a member with that identity, if one exists. Common values for source
include github
, twitter
, and email
.
createMember(data)
const data = {
member: {
twitter: 'janesmith_',
name: 'jane Smith',
tags: ['champion', 'feedback']
}
}
orbitMembers.createMember(data).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})
updateMember([memberId], data)
const memberId = 'janesmith04'
const data = {
bio: 'New bio'
}
orbitMembers.updateMember(memberId, data).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})
You can omit memberId
and provide only the data object, but you must then provide an identity object.
deleteMember(memberId)
const memberId = 'janesmith04'
orbitMembers.deleteMember(memberId).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})
addIdentity(memberId, data)
const memberId = 'janesmith04'
const data = {
source: 'youtube',
username: 'janesmith1990'
}
orbitMembers.addIdentity(memberId, data).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})
removeIdentity(memberId, data)
const memberId = 'janesmith04'
const data = {
source: 'youtube',
username: 'janesmith1990'
}
orbitMembers.removeIdentity(memberId, data).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})
We 💜 contributions from everyone! Check out the Contributing Guidelines for more information.
This is available as open source under the terms of the MIT License.
This project uses the Contributor Code of Conduct. We ask everyone to please adhere by its guidelines.