-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.ts
More file actions
40 lines (33 loc) · 1.24 KB
/
example.ts
File metadata and controls
40 lines (33 loc) · 1.24 KB
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
40
import { createRoxy } from '@roxyapi/sdk';
const roxy = createRoxy(process.env.ROXY_API_KEY!);
/**
* Three-card tarot spread: Past, Present, Future. The most-drawn spread on every tarot platform.
* Seeded RNG over the curated 78-card Rider-Waite-Smith deck for deterministic per-user readings.
* Part of the RoxyAPI tarot domain.
*/
async function main() {
const { data, error } = await roxy.tarot.castThreeCard({
body: {
question: 'What do I need to know about my career?',
seed: 'sample-user-2026',
},
});
if (error) throw new Error(error.error);
console.log('Spread:', data.spread);
console.log('Question:', data.question);
console.log('Seed:', data.seed);
console.log('');
for (const pos of data.positions) {
const reversal = pos.card.reversed ? ' (reversed)' : '';
console.log(`${pos.position}. ${pos.name}: ${pos.card.name}${reversal}`);
console.log(' Arcana:', pos.card.arcana);
console.log(' Keywords:', pos.card.keywords.join(', '));
console.log(' Position meaning:', pos.interpretation.slice(0, 120) + '...');
console.log(' Image:', pos.card.imageUrl);
console.log('');
}
if (data.summary) {
console.log('Summary:', data.summary);
}
}
main().catch(console.error);