npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kakaowork-api

v1.1.9

Published

kakaowork bot api

Downloads

15

Readme

kakaowork-api

카카오워크 Web API 를 편리하게 사용할 수 있는 Node Library 입니다.

사용방법

설치

npm 으로 설치할 수 있습니다.

npm install kakaowork-api

환경변수 설정

KAKAOWORK_BOT_API_KEY 이름으로 카카오워크 관리자 페이지에서 발급받은 API KEY를 환경 변수에 등록하세요.

Window) set KAKAOWORK_BOT_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx
Linux) export KAKAOWORK_BOT_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx

API 사용

kakaowork-api/fetches 하위에 서브 디렉토리 구조로 API 를 Import 하여 사용하실 수 있습니다.

import { ... } from 'kakaowork-api/fetches/users';
import { ... } from 'kakaowork-api/fetches/conversations';
import { ... } from 'kakaowork-api/fetches/messages';
import { ... } from 'kakaowork-api/fetches/departments';
import { ... } from 'kakaowork-api/fetches/spaces';
import { ... } from 'kakaowork-api/fetches/bots';

MessageBlock Generator 사용

Message를 보낼 때 사용되는 Block을 손쉽게 사용할 수 있도록 Generator 유틸 함수를 제공합니다.

import { textBlock, buttonBlock, ... } from 'kakaowork-api/blocks';

실제 Message를 보낼 때는 다음과 같이 사용할 수 있습니다.

import { fetchMessagesSend } from 'kakaowork-api/fetches/messages';
import { textBlock, buttonBlock } from 'kakaowork-api/blocks';

fetchMessageSend(conversationId, {
  text: '전송할 텍스트',
  blocks: [
    textBlock('텍스트블록'),
    buttonBlock({
      text: 'Button1',
      style: 'primary',
      action_type: 'open_inapp_browser',
      value: 'value'
    })
  ]
});

TypeScript를 지원하며, 필요한 타입들은 전부 정의되어 있습니다.

Reactive

카카오워크 Reactive 는 직접 호출하는 방식이 아닌, 카카오워크 내부 서버에서 호출하면 응답하는 방식으로 되어있습니다. 따라서 request API는 제공되지 않습니다.

하지만 Block Generator 함수는 제공되어, Modal Block을 반환할 때는 사용할 수 있습니다.

import { labelBlock, inputBlock, selectBlock } from 'kakaowork-api/blocks';

주의사항

카카오워크에서 공식적으로 제공하는 라이브러리가 아니며, 추후 카카오워크 API가 변경되면 정상적으로 동작하지 않을 수도 있습니다.

License

MIT