
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
API client and React hooks for NLdoc backend services.
npm install @nldoc/api
useApiClientA React hook that creates an API client instance for communicating with NLdoc backend services.
import { useApiClient } from '@nldoc/api'
function MyComponent() {
const apiClient = useApiClient('https://nldoc.nl/api')
// or use a relative path
const apiClient = useApiClient('/api')
// apiClient will be null if no route is provided
if (!apiClient) return null
// Use the client...
}
Parameters:
apiRoute: string | null | undefined - The API route URL. Can be:
'https://nldoc.nl/api')'/api') - will be resolved relative to the current window locationnull or undefined - returns nullReturns: APIClient | null
useConversionA React hook for converting documents using NLdoc's Conversion API.
import { useConversion, ContentType } from '@nldoc/api'
function MyComponent() {
const file = new Blob([JSON.stringify(myDocument)], { type: ContentType.Tiptap })
const apiRoute = 'https://nldoc.nl/api'
const conversion = useConversion(file, ContentType.HTML, apiRoute)
// conversion.status can be: 'idle' | 'converting' | 'converted' | 'error'
if (conversion.status === 'converted') {
console.log(conversion.result) // The converted document
}
}
Parameters:
file: Blob | null - The file to convertto: string - The target content type (use ContentType constants)apiRoute: string | null | undefined - The API route URLReturns: UseConversion - An object containing the conversion status and result
The package exports common content type constants:
import { ContentType } from '@nldoc/api'
ContentType.HTML // 'text/html'
ContentType.Tiptap // 'application/vnd.nldoc+json'
// ... and more
EUPL-1.2
FAQs
API client and React hooks for NLdoc backend services.
We found that @nldoc/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.