When using the Deskofy Core Library, it is important to verify whether your application is running inside the Deskofy environment or a regular web browser. The library’s features only work when the application is running inside Deskofy.
You can perform this check using the isInDeskofy()
function. For example:
import { isInDeskofy } from '@deskofy/core';
const sampleFunction = () => {
const inDeskofy = isInDeskofy();
if (inDeskofy) {
// Execute Deskofy-specific code here
}
}
Performing this check is necessary to prevent unexpected errors when the application runs in a normal browser.
If you are using frameworks like Next.js, the Core Library only works on the client side. You must add use client
at the top of your page. Server-side rendered pages cannot access the Deskofy Core Library.