![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@microsoft/ocsdk
Advanced tools
This repo contains the source code for getting up and running with the Omnichannel SDK on the web using standard web technologies and on mobile using React Native.
npm install
npm run watch
npm run build:dev
npm run build:prod
npm run lint
Lint checks is enabled by default in watch mode.
const params = {
orgUrl: '',
orgId: '',
widgetId: '',
}
const ocsdk = Microsoft.CRM.Omnichannel.SDK.SDKProvider.getSDK(params);
window.ocsdk = ocsdk;
const params = {
orgUrl: '',
orgId: '',
widgetId: '',
}
const configuration = {
getChatTokenRetryCount: 35,
getChatTokenTimeBetweenRetriesOnFailure: 10000,
maxRequestRetriesOnFailure: 5
};
const ocsdk = Microsoft.CRM.Omnichannel.SDK.SDKProvider.getSDK(params, configuration);
window.ocsdk = ocsdk;
// Manually generate request id
const requestId = Microsoft.CRM.Omnichannel.SDK.Util.uuidv4();
try {
const config = await window.ocsdk.getChatConfig(requestId);
// success
} catch {
// failure
}
// Auto generate request id
try {
const config = await window.ocsdk.getChatConfig();
// success
} catch {
// failure
}
// Manually generate request id
const requestId = Microsoft.CRM.Omnichannel.SDK.Util.uuidv4();
try {
const chatToken = await window.ocsdk.getChatToken(requestId);
// success
} catch {
// failure
}
// Auto generate request id
try {
const chatToken = await window.ocsdk.getChatToken();
const {requestId} = chatToken; // Request ID auto generated used to getChatToken
// success
} catch {
// failure
}
const requestId = Microsoft.CRM.Omnichannel.SDK.Util.uuidv4();
const optionalParams = {
authenticatedUserToken: '',
getContext: true, // Automically gets browser, device, location & os info
initContext: { // Optional init context to pass
locale: '', // 'en-us' by default if not set
originalurl: '', // window.href.location by default
os: '',
browser: '',
device: '',
longitude: '',
latitiude: '',
preChatResponse: {}
}
};
try {
await window.ocsdk.sessionInit(requestId, optionalParams);
// success
} catch {
// failure
}
const requestId = Microsoft.CRM.Omnichannel.SDK.Util.uuidv4();
const optionalParams = {
authenticatedUserToken: '',
};
try {
await window.ocsdk.sessionClose(requestId, optionalParams);
// success
} catch {
// failure
}
const requestId = Microsoft.CRM.Omnichannel.SDK.Util.uuidv4();
const postChatResponse = {};
const optionalParams = {
authenticatedUserToken: '',
};
try {
await window.ocsdk.submitPostChatResponse(requestId, postChatResponse, optionalParams);
// success
} catch {
// failure
}
const requestId = Microsoft.CRM.Omnichannel.SDK.Util.uuidv4();
const chatId = ''; // Chat thread ID
const token = ''; // Skype token
const optionalParams = {
authenticatedUserToken: '',
};
try {
const response = await window.ocsdk.getChatTranscripts(requestId, chatId, token, optionalParams);
// success
} catch {
// failure
}
const requestId = Microsoft.CRM.Omnichannel.SDK.Util.uuidv4();
const token = ''; // Skype token
const emailRequestBody = { // Email body
ChatId: '', // Chat thread ID
EmailAddress: 'contoso@microsoft.com',
DefaultAttachmentMessage: '',
CustomerLocale: 'en-us'
};
const optionalParams = {
authenticatedUserToken: '',
};
try {
await window.ocsdk.emailTranscript(requestId, token, emailRequestBody, optionalParams);
// success
} catch {
// failure
}
// Manually generate request id
const requestId = Microsoft.CRM.Omnichannel.SDK.Util.uuidv4();
try {
const response = await window.ocsdk.fetchDataMaskingInfo(requestId);
// success
} catch {
// failure
}
// Auto generate request id
try {
const response = await window.ocsdk.fetchDataMaskingInfo();
// success
} catch {
// failure
}
These are the available config options with its default values for the SDK.
{
/**
* Number of times a getchattoken request is retried.
*/
getChatTokenRetryCount: 35,
/**
* Time in milliseconds between two successive getchattoken retry requests.
*/
getChatTokenTimeBetweenRetriesOnFailure: 10000,
/**
* Maximum number of request retries before failing.
*/
maxRequestRetriesOnFailure: 5,
}
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
FAQs
Microsoft Omnichannel SDK
The npm package @microsoft/ocsdk receives a total of 1,105 weekly downloads. As such, @microsoft/ocsdk popularity was classified as popular.
We found that @microsoft/ocsdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.