3

How can I hide api key in bixby-studio?

I want to make bixby capsule Using API data. but I can't find how to hide API key

this is example code at code/requestmovie.js

module.exports.function = function requestmovie () {

  const http = require('http');
  const console = require("console")

  // here !!
  let url = 'url with api key'

  let response = http.getUrl(url, {format: 'xmljs'})
  let MovieList = {}
  let lists = response.movieList

  MovieList.firstmovietitle = lists[0].movieNm

  return MovieList
}

I want to hide my API key

1 Answers1

6

Bixby provides the ability to save secrets and safely access them from your code.

https://bixbydevelopers.com/dev/docs/reference/JavaScriptAPI/secret

  1. Define the secret you want to define at https://bixbydevelopers.com/
  2. Access it with secret.get([your secret name])

bixby dev site

Pete Haas
  • 1,800
  • 1
  • 12
  • 15
  • 2
    Using the configuration system lets let you keep your API key secure. An additional benefit is that you can update the key even after your capsule is released to the marketplace. – dogethis Jun 02 '19 at 19:34
  • 2
    Copy from Jatin: Here's more information on using Capsule Configuration and the Developer Center's Config & Secrets feature: https://bixbydevelopers.com/dev/docs/reference/ref-topics/capsule-config – BixbyDevSupport-Tokonyan Jun 05 '19 at 18:12