Skip to content

Commit 0de864c

Browse files
committed
First version of docs complete.
1 parent 021e186 commit 0de864c

12 files changed

Lines changed: 409 additions & 1060 deletions

src/components/Header.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ export const Header = forwardRef(function Header({ className }, ref) {
6969
<nav className="hidden md:block">
7070
<ul role="list" className="flex items-center gap-8">
7171
<TopLevelNavItem href="/">API</TopLevelNavItem>
72-
<TopLevelNavItem href="#">Documentation</TopLevelNavItem>
73-
<TopLevelNavItem href="#">Support</TopLevelNavItem>
72+
<TopLevelNavItem href="/">Documentation</TopLevelNavItem>
73+
<TopLevelNavItem href="https://sentrypeer.com/contact">Support</TopLevelNavItem>
7474
</ul>
7575
</nav>
7676
<div className="hidden md:block md:h-5 md:w-px md:bg-zinc-900/10 md:dark:bg-white/15" />
@@ -79,7 +79,7 @@ export const Header = forwardRef(function Header({ className }, ref) {
7979
<ModeToggle />
8080
</div>
8181
<div className="hidden min-[416px]:contents">
82-
<Button href="#">Sign in</Button>
82+
<Button href="https://sentrypeer.com/login">Sign in</Button>
8383
</div>
8484
</div>
8585
</motion.div>

src/components/Navigation.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,16 @@ export const navigation = [
189189
links: [
190190
{ title: 'Introduction', href: '/' },
191191
{ title: 'Quickstart', href: '/quickstart' },
192-
{ title: 'SDKs', href: '/sdks' },
193192
{ title: 'Authentication', href: '/authentication' },
194193
{ title: 'Errors', href: '/errors' },
195194
],
196195
},
197196
{
198197
title: 'Resources',
199198
links: [
200-
{ title: 'Conversations', href: '/conversations' },
201-
{ title: 'Messages', href: '/messages' },
199+
{ title: 'Phone Numbers', href: '/phone-numbers' },
200+
{ title: 'IP Addresses', href: '/ip-addresses' },
201+
{ title: 'Honeypot Events', href: '/honeypot-events' },
202202
],
203203
},
204204
]
@@ -208,8 +208,8 @@ export function Navigation(props) {
208208
<nav {...props}>
209209
<ul role="list">
210210
<TopLevelNavItem href="/">API</TopLevelNavItem>
211-
<TopLevelNavItem href="#">Documentation</TopLevelNavItem>
212-
<TopLevelNavItem href="#">Support</TopLevelNavItem>
211+
<TopLevelNavItem href="/">Documentation</TopLevelNavItem>
212+
<TopLevelNavItem href="https://sentrypeer.com/contact">Support</TopLevelNavItem>
213213
{navigation.map((group, groupIndex) => (
214214
<NavigationGroup
215215
key={group.title}
@@ -218,7 +218,7 @@ export function Navigation(props) {
218218
/>
219219
))}
220220
<li className="sticky bottom-0 z-10 mt-6 min-[416px]:hidden">
221-
<Button href="#" variant="filled" className="w-full">
221+
<Button href="https://sentrypeer.com/login" variant="filled" className="w-full">
222222
Sign in
223223
</Button>
224224
</li>

src/components/Resources.jsx

Lines changed: 125 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,144 @@
11
import Link from 'next/link'
2-
import { motion, useMotionTemplate, useMotionValue } from 'framer-motion'
2+
import {motion, useMotionTemplate, useMotionValue} from 'framer-motion'
33

4-
import { GridPattern } from '@/components/GridPattern'
5-
import { Heading } from '@/components/Heading'
6-
import { ChatBubbleIcon } from '@/components/icons/ChatBubbleIcon'
7-
import { EnvelopeIcon } from '@/components/icons/EnvelopeIcon'
8-
import { UserIcon } from '@/components/icons/UserIcon'
9-
import { UsersIcon } from '@/components/icons/UsersIcon'
4+
import {GridPattern} from '@/components/GridPattern'
5+
import {Heading} from '@/components/Heading'
6+
import {ShapesIcon} from "@/components/icons/ShapesIcon";
7+
import {MapPinIcon} from "@/components/icons/MapPinIcon";
8+
import {SquaresPlusIcon} from "@/components/icons/SquaresPlusIcon";
109

1110
const resources = [
12-
{
13-
href: '/messages',
14-
name: 'Messages',
15-
description:
16-
'Learn about the message model and how to create, retrieve, update, delete, and list messages.',
17-
icon: EnvelopeIcon,
18-
pattern: {
19-
y: 32,
20-
squares: [
21-
[0, 2],
22-
[1, 4],
23-
],
11+
{
12+
href: '/phone-numbers',
13+
name: 'Phone numbers',
14+
description:
15+
'Learn about the Phone Numbers model and how to query for a phone number that you are checking is good or bad to call.',
16+
icon: ShapesIcon,
17+
pattern: {
18+
y: 32,
19+
squares: [
20+
[0, 2],
21+
[1, 4],
22+
],
23+
},
2424
},
25-
},
26-
{
27-
href: '/groups',
28-
name: 'Groups',
29-
description:
30-
'Learn about the group model and how to create, retrieve, update, delete, and list groups.',
31-
icon: UsersIcon,
32-
pattern: {
33-
y: 22,
34-
squares: [[0, 1]],
25+
{
26+
href: '/ip-addresses',
27+
name: 'IP addresses',
28+
description:
29+
'Learn about the IP address model and how to query for the source address of a early reconnaissance attack.',
30+
icon: MapPinIcon,
31+
pattern: {
32+
y: 22,
33+
squares: [[0, 1]],
34+
},
35+
},
36+
{
37+
href: '/honeypot-events',
38+
name: 'Honeypot events',
39+
description:
40+
'Learn about the Events model and how to create a honeypot event you have detected on your network.',
41+
icon: SquaresPlusIcon,
42+
pattern: {
43+
y: 22,
44+
squares: [[0, 1]],
45+
},
3546
},
36-
},
3747
]
3848

39-
function ResourceIcon({ icon: Icon }) {
40-
return (
41-
<div className="flex h-7 w-7 items-center justify-center rounded-full bg-zinc-900/5 ring-1 ring-zinc-900/25 backdrop-blur-[2px] transition duration-300 group-hover:bg-white/50 group-hover:ring-zinc-900/25 dark:bg-white/7.5 dark:ring-white/15 dark:group-hover:bg-indigo-300/10 dark:group-hover:ring-indigo-400">
42-
<Icon className="h-5 w-5 fill-zinc-700/10 stroke-zinc-700 transition-colors duration-300 group-hover:stroke-zinc-900 dark:fill-white/10 dark:stroke-zinc-400 dark:group-hover:fill-indigo-300/10 dark:group-hover:stroke-indigo-400" />
43-
</div>
44-
)
49+
function ResourceIcon({icon: Icon}) {
50+
return (
51+
<div
52+
className="flex h-7 w-7 items-center justify-center rounded-full bg-zinc-900/5 ring-1 ring-zinc-900/25 backdrop-blur-[2px] transition duration-300 group-hover:bg-white/50 group-hover:ring-zinc-900/25 dark:bg-white/7.5 dark:ring-white/15 dark:group-hover:bg-indigo-300/10 dark:group-hover:ring-indigo-400">
53+
<Icon
54+
className="h-5 w-5 fill-zinc-700/10 stroke-zinc-700 transition-colors duration-300 group-hover:stroke-zinc-900 dark:fill-white/10 dark:stroke-zinc-400 dark:group-hover:fill-indigo-300/10 dark:group-hover:stroke-indigo-400"/>
55+
</div>
56+
)
4557
}
4658

47-
function ResourcePattern({ mouseX, mouseY, ...gridProps }) {
48-
let maskImage = useMotionTemplate`radial-gradient(180px at ${mouseX}px ${mouseY}px, white, transparent)`
49-
let style = { maskImage, WebkitMaskImage: maskImage }
59+
function ResourcePattern({mouseX, mouseY, ...gridProps}) {
60+
let maskImage = useMotionTemplate`radial-gradient(180px at ${mouseX}px ${mouseY}px, white, transparent)`
61+
let style = {maskImage, WebkitMaskImage: maskImage}
5062

51-
return (
52-
<div className="pointer-events-none">
53-
<div className="absolute inset-0 rounded-2xl transition duration-300 [mask-image:linear-gradient(white,transparent)] group-hover:opacity-50">
54-
<GridPattern
55-
width={72}
56-
height={56}
57-
x="50%"
58-
className="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/[0.02] stroke-black/5 dark:fill-white/1 dark:stroke-white/2.5"
59-
{...gridProps}
60-
/>
61-
</div>
62-
<motion.div
63-
className="absolute inset-0 rounded-2xl bg-gradient-to-r from-[#6D50A0] to-indigo-600/30 opacity-0 transition duration-300 group-hover:opacity-100 dark:from-[#202D2E] dark:to-[#303428]"
64-
style={style}
65-
/>
66-
<motion.div
67-
className="absolute inset-0 rounded-2xl opacity-0 mix-blend-overlay transition duration-300 group-hover:opacity-100"
68-
style={style}
69-
>
70-
<GridPattern
71-
width={72}
72-
height={56}
73-
x="50%"
74-
className="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/50 stroke-black/70 dark:fill-white/2.5 dark:stroke-white/10"
75-
{...gridProps}
76-
/>
77-
</motion.div>
78-
</div>
79-
)
63+
return (
64+
<div className="pointer-events-none">
65+
<div
66+
className="absolute inset-0 rounded-2xl transition duration-300 [mask-image:linear-gradient(white,transparent)] group-hover:opacity-50">
67+
<GridPattern
68+
width={72}
69+
height={56}
70+
x="50%"
71+
className="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/[0.02] stroke-black/5 dark:fill-white/1 dark:stroke-white/2.5"
72+
{...gridProps}
73+
/>
74+
</div>
75+
<motion.div
76+
className="absolute inset-0 rounded-2xl bg-gradient-to-r from-[#6D50A0] to-indigo-600/30 opacity-0 transition duration-300 group-hover:opacity-100 dark:from-[#202D2E] dark:to-[#303428]"
77+
style={style}
78+
/>
79+
<motion.div
80+
className="absolute inset-0 rounded-2xl opacity-0 mix-blend-overlay transition duration-300 group-hover:opacity-100"
81+
style={style}
82+
>
83+
<GridPattern
84+
width={72}
85+
height={56}
86+
x="50%"
87+
className="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/50 stroke-black/70 dark:fill-white/2.5 dark:stroke-white/10"
88+
{...gridProps}
89+
/>
90+
</motion.div>
91+
</div>
92+
)
8093
}
8194

82-
function Resource({ resource }) {
83-
let mouseX = useMotionValue(0)
84-
let mouseY = useMotionValue(0)
95+
function Resource({resource}) {
96+
let mouseX = useMotionValue(0)
97+
let mouseY = useMotionValue(0)
8598

86-
function onMouseMove({ currentTarget, clientX, clientY }) {
87-
let { left, top } = currentTarget.getBoundingClientRect()
88-
mouseX.set(clientX - left)
89-
mouseY.set(clientY - top)
90-
}
99+
function onMouseMove({currentTarget, clientX, clientY}) {
100+
let {left, top} = currentTarget.getBoundingClientRect()
101+
mouseX.set(clientX - left)
102+
mouseY.set(clientY - top)
103+
}
91104

92-
return (
93-
<div
94-
key={resource.href}
95-
onMouseMove={onMouseMove}
96-
className="group relative flex rounded-2xl bg-zinc-50 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 dark:bg-white/2.5 dark:hover:shadow-black/5"
97-
>
98-
<ResourcePattern {...resource.pattern} mouseX={mouseX} mouseY={mouseY} />
99-
<div className="absolute inset-0 rounded-2xl ring-1 ring-inset ring-zinc-900/7.5 group-hover:ring-zinc-900/10 dark:ring-white/10 dark:group-hover:ring-white/20" />
100-
<div className="relative rounded-2xl px-4 pb-4 pt-16">
101-
<ResourceIcon icon={resource.icon} />
102-
<h3 className="mt-4 text-sm font-semibold leading-7 text-zinc-900 dark:text-white">
103-
<Link href={resource.href}>
104-
<span className="absolute inset-0 rounded-2xl" />
105-
{resource.name}
106-
</Link>
107-
</h3>
108-
<p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
109-
{resource.description}
110-
</p>
111-
</div>
112-
</div>
113-
)
105+
return (
106+
<div
107+
key={resource.href}
108+
onMouseMove={onMouseMove}
109+
className="group relative flex rounded-2xl bg-zinc-50 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 dark:bg-white/2.5 dark:hover:shadow-black/5"
110+
>
111+
<ResourcePattern {...resource.pattern} mouseX={mouseX} mouseY={mouseY}/>
112+
<div
113+
className="absolute inset-0 rounded-2xl ring-1 ring-inset ring-zinc-900/7.5 group-hover:ring-zinc-900/10 dark:ring-white/10 dark:group-hover:ring-white/20"/>
114+
<div className="relative rounded-2xl px-4 pb-4 pt-16">
115+
<ResourceIcon icon={resource.icon}/>
116+
<h3 className="mt-4 text-sm font-semibold leading-7 text-zinc-900 dark:text-white">
117+
<Link href={resource.href}>
118+
<span className="absolute inset-0 rounded-2xl"/>
119+
{resource.name}
120+
</Link>
121+
</h3>
122+
<p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
123+
{resource.description}
124+
</p>
125+
</div>
126+
</div>
127+
)
114128
}
115129

116130
export function Resources() {
117-
return (
118-
<div className="my-16 xl:max-w-none">
119-
<Heading level={2} id="resources">
120-
Resources
121-
</Heading>
122-
<div className="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-zinc-900/5 pt-10 dark:border-white/5 sm:grid-cols-2 xl:grid-cols-4">
123-
{resources.map((resource) => (
124-
<Resource key={resource.href} resource={resource} />
125-
))}
126-
</div>
127-
</div>
128-
)
131+
return (
132+
<div className="my-16 xl:max-w-none">
133+
<Heading level={2} id="resources">
134+
Resources
135+
</Heading>
136+
<div
137+
className="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-zinc-900/5 pt-10 dark:border-white/5 sm:grid-cols-2 xl:grid-cols-4">
138+
{resources.map((resource) => (
139+
<Resource key={resource.href} resource={resource}/>
140+
))}
141+
</div>
142+
</div>
143+
)
129144
}

src/pages/authentication.mdx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,28 @@ export const description =
55

66
You'll need to authenticate your requests to access any of the endpoints in the SentryPeer API. In this guide, we'll look at how authentication works. SentryPeer offers two ways to authenticate your API requests: Basic authentication and OAuth2 with a token — OAuth2 is the recommended way. {{ className: 'lead' }}
77

8-
## OAuth2 with bearer token
9-
10-
The only way to authenticate with the SentryPeer API is by using OAuth2. When establishing a connection using OAuth2, you will need your access token — you will find it in the [SentryPeer dashboard](#) under API settings. Here's how to add the token to the request header using cURL:
11-
12-
```bash {{ title: 'Example request with bearer token' }}
13-
curl https://sentrypeer.com/api/conversations \
14-
-H "Authorization: Bearer {token}"
8+
## OAuth2 client credentials request
9+
10+
The only way to authenticate with the SentryPeer API is by using OAuth2.
11+
When establishing a connection using OAuth2, you will first need your client credentials,
12+
then you can request your access token —
13+
you will find your client credentials in the [SentryPeer Settings](https://sentrypeer.com/settings) section after creating a client.
14+
Here's how to request a token using cURL:
15+
16+
```bash {{ title: 'Example request to retrieve your bearer token' }}
17+
curl --request POST --url https://authz.sentrypeer.com/oauth/token \
18+
--header 'content-type: application/json' \
19+
--data '{"client_id":"{ your_client_id }","client_secret":"{ your_client_secret", "audience":"https://sentrypeer.com/api","grant_type":"client_credentials"}'
1520
```
1621

17-
Always keep your token safe and reset it if you suspect it has been compromised.
22+
Always keep your client credentials safe and reset your client secret if you suspect it has been compromised. Better yet,
23+
create a new client and delete the old one.
1824

19-
## Using an SDK
25+
## Querying a Resource
2026

21-
If you use one of our official SDKs, you won't have to worry about any of the above — fetch your access token from the [SentryPeer dashboard](#) under API settings, and the client library will take care of the rest. All the client libraries use OAuth2 behind the scenes.
27+
Once you have requested your token (tokens are valid for 24 hours), you can start making requests to the SentryPeer API.
2228

23-
<div className="not-prose">
24-
<Button
25-
href="/sdks"
26-
variant="text"
27-
arrow="right"
28-
children="Check out our list of first-party SDKs"
29-
/>
30-
</div>
29+
```bash {{ title: 'Example request with bearer token' }}
30+
curl https://sentrypeer.com/api/phone-numbers/{phone-number} \
31+
--header "Authorization: Bearer {your_token_from_previous_step}"
32+
```

0 commit comments

Comments
 (0)