Skip to content

Commit 05cb618

Browse files
committed
Fix content link documentation to correctly describe options
Update the documentation to accurately state: - contentLink: 'v1' enables stega encoding - baseEditingUrl tells DatoCMS where the project is located (not the preview) - Both options are required Also fix inconsistency in troubleshooting section (was using 'vercel-v1' instead of 'v1')
1 parent 233bf95 commit 05cb618

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

docs/content-link.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const result = await executeQuery(query, {
107107
});
108108
```
109109

110-
The `contentLink` option encodes invisible metadata into text fields, while `baseEditingUrl` tells DatoCMS where your preview is hosted.
110+
The `contentLink: 'v1'` option enables stega encoding, which embeds invisible metadata into text fields. The `baseEditingUrl` tells DatoCMS where your project is located so edit URLs can be generated correctly. Both options are required.
111111

112112
### 2. Add the ContentLink component
113113

@@ -583,7 +583,7 @@ These utilities are useful when you need to:
583583
```js
584584
const result = await executeQuery(query, {
585585
token: 'YOUR_API_TOKEN',
586-
contentLink: 'vercel-v1',
586+
contentLink: 'v1',
587587
baseEditingUrl: 'https://your-project.admin.datocms.com',
588588
});
589589
```

src/VideoPlayer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import MuxPlayer from '@mux/mux-player-react/lazy';
2626
// data from DatoCMS GraphQL API and returns props as expected by the
2727
// `<MuxPlayer />` component.
2828

29-
import { useVideoPlayer } from '../useVideoPlayer/index.js';
3029
import { decodeStega } from '@datocms/content-link';
30+
import { useVideoPlayer } from '../useVideoPlayer/index.js';
3131

3232
type Maybe<T> = T | null;
3333
type Possibly<T> = Maybe<T> | undefined;

src/useContentLink/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ export function useContentLink(
8989
// The onNavigateTo callback is accessed via ref, so changes don't trigger recreation
9090
useEffect(() => {
9191
// Check if controller is disabled
92-
const isEnabled = enabled === true || (typeof enabled === 'object' && enabled !== null);
92+
const isEnabled =
93+
enabled === true || (typeof enabled === 'object' && enabled !== null);
9394

9495
if (!isEnabled) {
9596
if (controllerRef.current) {

0 commit comments

Comments
 (0)