Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
yandex-metrika
Advanced tools
Библиотека для работы с API Яндекс.Метрики
Weekly downloads
Readme
Библиотека для API Яндекс.Метрики Для работы с данной библиотекой вам необходимо иметь OAuth-токен приложения Яндекс.Метрики. Для того, чтобы создать приложение:
const YMetrikaRequest = require( 'yandex-metrika' ),
oauth_token = 'OAuth токен',
counterId = 3123123, // id счётчика
api = new YMetrikaRequest( oauth_token );
/*
получить информацию о счтчике по id
GET /management/v1/counter/{counterId}
*/
api.get( `/management/v1/counter/${counterId}` )
.then( data => {
console.log( data );
});
// аналогично
api.request( `/management/v1/counter/${counterId}`, 'GET' )
.then( data => {
console.log( data );
});
/*
Создать новую цель
POST https://api-metrika.yandex.ru/management/v1/counter/{counterId}/goals
*/
api.post( `https://api-metrika.yandex.ru/management/v1/counter/${counterId}/goals`, {
name: 'Пробыл на сайте N минут',
type: 'action',
conditions: [
{
type: "exact",
url: "goal_slug"
}
]
})
.then( data => {
console.log( data );
});
/**
* Формирует GET, POST, PUT, DELETE запросы соответственно
* @param {String} url Адрес запроса на сервере, начиная с /
* @param {Object} data Данные для запроса (не включая token)
* @param {Object} headers Заголовки запроса
* @return {Promise} Обещание ответа
*/
api.get( url, data = {}, headers = {})
api.post( url, data = {}, headers = {})
api.put( url, data = {}, headers = {})
api.delete( url, data = {}, headers = {})
// формирует свободный запрос
api.request( url, method = 'GET', data = {}, headers = {})
Сделать тесты
FAQs
Библиотека для работы с API Яндекс.Метрики
The npm package yandex-metrika receives a total of 1 weekly downloads. As such, yandex-metrika popularity was classified as not popular.
We found that yandex-metrika demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.