forked from pjetcetal/clubhouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.js
39 lines (28 loc) · 1.09 KB
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict'
require('dotenv-safe').config()
const { ClubhouseClient } = require('clubhouse-client')
// basic example of how to use the ClubhouseClient for a previously authenticated user
async function main() {
const authToken = process.env.CLUBHOUSE_AUTH_TOKEN
const deviceId = process.env.CLUBHOUSE_DEVICE_ID
const userId = process.env.CLUBHOUSE_USER_ID
const clubhouse = new ClubhouseClient({
authToken,
deviceId,
userId
})
const seedUserId = '4'
const profile = await clubhouse.getProfile(seedUserId)
console.log(JSON.stringify(profile, null, 2))
const followers = await clubhouse.getFollowers(seedUserId)
console.log(JSON.stringify(followers, null, 2))
const following = await clubhouse.getFollowing(seedUserId)
console.log(JSON.stringify(following, null, 2))
// const allFollowing = await clubhouse.getAllFollowing(seedUserId)
// console.log(JSON.stringify(allFollowing, null, 2))
// const allFollowers = await clubhouse.getAllFollowers(seedUserId)
// console.log(JSON.stringify(allFollowers, null, 2))
}
main().catch((err) => {
console.error(err)
})