
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@odnoklassniki/ok-apps-sdk
Advanced tools
import OKSDK from '@odnoklassniki/ok-apps-sdk';
// Init SDK
await OKSDK.init();
For use in a browser, include the file dist/browser.min.js
and use as follows
<script src="https://unpkg.com/@odnoklassniki/ok-apps-sdk/dist/browser.min.js"></script>
<script>
// Init SDK
OKSDK.init()
.then(mode => {...})
.catch(error => {...});
</script>
OKSDK.Methods
Contains groups of methods that avalable and recommended for use
Some of them return promise with response
Response fields
status
Text with status ok | errordata
Data of response string | boolean | number | objectExample
const {status, data: appId} = await OKSDK.Methods.Utils.getAppId();
Some of them return value synchronously
Example
const isSupported = OKSDK.Methods.Utils.isSupported(); // boolean
Some of them need callback to be provided
Callback arguments
status
Text with status ok | errordata
Data of response string | boolean | number | objectExample
const callback = (status, data) => {
console.log(data);
};
OKSDK.Methods.Utils.observeServiceCallbacks('DEVICE_ORIENTATION', callback);
OKSDK.invoke
OKSDK.invokeUIMethod
@DepricatedThis methods allow you to call methods as it was done in previous versions of SDK
Parameters
method
required Method nameparams
optional Array of parameterscallback
optional Callback for getting resultExample
// Sending event to client
OKSDK.invoke('joinGroup', [groupId], ({status, data}) => {});
OKSDK.Client.call
Call API methods
Parameters
params
required Object with call params including method namecallback
optional A function that will be called after the server respondsresig
optional Required when it is necessary to request user confirmation for any action through a separate preview. In all other cases, call the function with only 2 parameters.Method can be used with callback or with promise
Example
// Sending event to client
const params = {
"method":"friends.get"
};
const callback = (status, data, error) => {
if (error) {
processError(error);
} else {
processFriendIds(data);
}
};
OKSDK.Client.call(params, callback);
OR
// Sending event to client
const params = {
"method":"friends.get"
};
const data = await OKSDK.Client.call(params);
FAQs
Connects an Application with OK client
The npm package @odnoklassniki/ok-apps-sdk receives a total of 1 weekly downloads. As such, @odnoklassniki/ok-apps-sdk popularity was classified as not popular.
We found that @odnoklassniki/ok-apps-sdk demonstrated a not healthy version release cadence and project activity because the last version was released 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.