All Projects → line → clova-cek-sdk-nodejs

line / clova-cek-sdk-nodejs

Licence: Apache-2.0 license
SDK of the Clova CEK for Node.js

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to clova-cek-sdk-nodejs

clova-cek-sdk-java
SDK of the Clova CEK for Java
Stars: ✭ 13 (-62.86%)
Mutual labels:  line, clova, cek-sdk
clova-cek-sdk-python
SDK of the Clova CEK for Python
Stars: ✭ 19 (-45.71%)
Mutual labels:  line, clova, cek-sdk
regl-line
Flat 2D and 3D line rending with Regl for WebGL
Stars: ✭ 44 (+25.71%)
Mutual labels:  line
colortest
Quickly show all your terminal colors
Stars: ✭ 66 (+88.57%)
Mutual labels:  line
SimpleCLI
Command Line Interface Library for Arduino
Stars: ✭ 197 (+462.86%)
Mutual labels:  line
line-example-bot-tiny-php
Line Bot 基礎範例程式碼教學 (PHP) - 輕量版 LINEBotTiny.php
Stars: ✭ 58 (+65.71%)
Mutual labels:  line
google streetview
A command line tool and module for Google Street View Image API
Stars: ✭ 77 (+120%)
Mutual labels:  line
LINE-Source
Line Application Source
Stars: ✭ 43 (+22.86%)
Mutual labels:  line
react-liff
A react context provider for LIFF (LINE Front-end Framework)
Stars: ✭ 22 (-37.14%)
Mutual labels:  line
linenotify
Template for LINE Notify service in Golang
Stars: ✭ 18 (-48.57%)
Mutual labels:  line
line-things-starter
The sample codes for LINE Things Developer Trial
Stars: ✭ 91 (+160%)
Mutual labels:  line
gab-cmdline
A GABStudios Java library to help with command line parsing.
Stars: ✭ 12 (-65.71%)
Mutual labels:  line
unosolo
Work-in-progress Rust application that converts C++ header-only libraries to single self-contained headers.
Stars: ✭ 26 (-25.71%)
Mutual labels:  line
text-sdk-php
PHP SDK to send messages with CM.com
Stars: ✭ 18 (-48.57%)
Mutual labels:  line
line-sdk-android
LINE SDK for Android lets you integrate LINE into your Android app to create a more engaging experience for your users.
Stars: ✭ 101 (+188.57%)
Mutual labels:  line
pyne
LINE for Python
Stars: ✭ 18 (-48.57%)
Mutual labels:  line
CHRLINE
LINE Chrome API
Stars: ✭ 41 (+17.14%)
Mutual labels:  line
react-svg-pathline
React component for drawing SVG path through set of points, smoothing the corners
Stars: ✭ 42 (+20%)
Mutual labels:  line
android-charts
A curated list of Android Chart libraries.
Stars: ✭ 69 (+97.14%)
Mutual labels:  line
line-sdk-unity
Provides a modern way of implementing LINE APIs in Unity games, for iOS and Android.
Stars: ✭ 84 (+140%)
Mutual labels:  line

Clova CEK SDK Nodejs

Build Status

Getting Started

Installing

$ npm install @line/clova-cek-sdk-nodejs

Example

const clova = require('@line/clova-cek-sdk-nodejs');
const express = require('express');
const bodyParser = require('body-parser');

const clovaSkillHandler = clova.Client
  .configureSkill()
  .onLaunchRequest(responseHelper => {
    responseHelper.setSimpleSpeech({
      lang: 'ja',
      type: 'PlainText',
      value: 'おはよう',
    });
  })
  .onIntentRequest(async responseHelper => {
    const intent = responseHelper.getIntentName();
    const sessionId = responseHelper.getSessionId();

    switch (intent) {
      case 'Clova.YesIntent':
        // Build speechObject directly for response
        responseHelper.setSimpleSpeech({
          lang: 'ja',
          type: 'PlainText',
          value: 'はいはい',
        });
        break;
      case 'Clova.NoIntent':
        // Or build speechObject with SpeechBuilder for response
        responseHelper.setSimpleSpeech(
          clova.SpeechBuilder.createSpeechText('いえいえ')
        );
        break;
    }
  })
  .onSessionEndedRequest(responseHelper => {
    const sessionId = responseHelper.getSessionId();

    // Do something on session end
  })
  .handle();

const app = new express();
const clovaMiddleware = clova.Middleware({ applicationId: "YOUR_APPLICATION_ID" });
// Use `clovaMiddleware` if you want to verify signature and applicationId.
// Please note `applicationId` is required when using this middleware.
app.post('/clova', clovaMiddleware, clovaSkillHandler);

// Or you can simply use `bodyParser.json()` to accept any request without verifying, e.g.,
app.post('/clova', bodyParser.json(), clovaSkillHandler);

NOTE: async/await is part of ECMAScript 2017 and is not supported some browsers, so use with caution.

Documentation

Contributing

Please check CONTRIBUTING.

npm scripts

  • npm test: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].