1.1.0 โ€ข Published 3 years ago

@zardoy/vk-params v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

VK Params ยท npm version GitHub top language gitmoji badge semantic-release

A small helper for working with VK launch params [ru]. Useful for vk-mini-apps.

Usage

import { vkGetParam } from "@zardoy/vk-params";

// No vk_ prefix needed
vkGetParam("app_id");
//=> 6739175

vkGetParam("are_notifications_enabled");
//=> false

API

vkGetParam(param)

Return value depends on param argument.

It is important to know, that if appropriate param in url doesn't exist this function will throw an Error.

vkIsDesktopVersion(): boolean

Shortcut for vkGetParam("platform") === "desktop_web".

paramNames

Array of names all VK launch params.

nullableParamNames

Same as previous, but contains only params that may not exist in url.

Things to note

  • If you are using React, you should use Error Boundary in the root of your app.
  • For proper typings support, use TypeScript v4 or higher.

Stats, file list and more package details

Please, let me know if you find a better alternative to this module.

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago