Skip to content

chore: update client instance refactor #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

iamnamananand996
Copy link
Contributor

Because

  • we need to update client instance to manage all .env

This commit

  • updated client instance refactor

@linear
Copy link

linear bot commented Sep 30, 2023

INS-2173 update .env management of the SDK

pochun.chiu says.
https://instill-ai.slack.com/archives/D05CBSLB5RP/p1695816480746359

I am thinking that your env approach on TS-SDK is not developer friendly,

  • If he is the Nextjs user, he won’t be able to set the env due to how nextjs env work
  • If he is a React user, most of the time he is using dot-env, he may need a additional wrapper to wrap things up
  • If he is a lambda function user, I would say he will face lots of trouble. For example, vercel function need to have NEXT prefix. How can he do that?

There has some solutions around this issue

  • When the user initialize the client, he need to input the needed env var, we store the env in the instance.
  • We write the whole SDK with class, and store all the initialize state in the class instance. In this way all the other function can share this state
  • We provide a yaml file for user to setup corresponding configuration instead of .env file <------ Which also has above issues
  • We setup multiple env rules, and you will identify them and choose the correct one. For example, we allow NEXT_PUBLIC and REACT_PUBLIC at the same time <------ This may not be ideal too

@iamnamananand996 iamnamananand996 merged commit d8aa4b7 into main Sep 30, 2023
@iamnamananand996 iamnamananand996 deleted the namananand/ins-2173-update-env-management-of-the-sdk branch September 30, 2023 12:46
iamnamananand996 pushed a commit that referenced this pull request Oct 2, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.0.8](https://github.com/instill-ai/typescript-sdk/compare/@instill-ai/typescript-sdk-v0.0.7...@instill-ai/typescript-sdk-v0.0.8)
(2023-10-01)


### Miscellaneous

* Namananand/ins 2172 update typescript sdk docs
([#20](#20))
([4961eaa](4961eaa))
* Namananand/ins 2235 update sdk docs for new refactor
([#24](#24))
([5143759](5143759))
* refactor docs and remove unused files
([#23](#23))
([5a080e1](5a080e1))
* update client instance refactor
([#22](#22))
([d8aa4b7](d8aa4b7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
iamnamananand996 pushed a commit that referenced this pull request Jan 17, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.0.2](instill-sdk-v0.0.1...instill-sdk-v0.0.2)
(2024-01-17)


### Miscellaneous

* adapt new core structure among instill-ai project
([#40](#40))
([6fc14eb](6fc14eb))
* add .npmignore
([#8](#8))
([f015420](f015420))
* add auto gen proto
([#4](#4))
([b0a016a](b0a016a))
* add custom header for createClient
([#16](#16))
([3db690c](3db690c))
* docs update
([#14](#14))
([dd13735](dd13735))
* folder rename example app
([#25](#25))
([d80a1b7](d80a1b7))
* init typescript sdk
([3dde8db](3dde8db))
* **main:** release @instill-ai/typescript-sdk 0.0.10
([#36](#36))
([3422f66](3422f66))
* **main:** release @instill-ai/typescript-sdk 0.0.11
([#39](#39))
([a727529](a727529))
* **main:** release @instill-ai/typescript-sdk 0.0.12
([#43](#43))
([c6a2afb](c6a2afb))
* **main:** release @instill-ai/typescript-sdk 0.0.2
([#2](#2))
([01a0b5f](01a0b5f))
* **main:** release @instill-ai/typescript-sdk 0.0.3
([#7](#7))
([47e51e7](47e51e7))
* **main:** release @instill-ai/typescript-sdk 0.0.4
([#9](#9))
([0fca8fb](0fca8fb))
* **main:** release @instill-ai/typescript-sdk 0.0.5
([#11](#11))
([a423bd1](a423bd1))
* **main:** release @instill-ai/typescript-sdk 0.0.6
([#13](#13))
([30728a5](30728a5))
* **main:** release @instill-ai/typescript-sdk 0.0.7
([#15](#15))
([1b62d32](1b62d32))
* **main:** release @instill-ai/typescript-sdk 0.0.8
([#21](#21))
([79bdee8](79bdee8))
* **main:** release @instill-ai/typescript-sdk 0.0.9
([#26](#26))
([3f70af1](3f70af1))
* manifest update
([38e0a39](38e0a39))
* Namananand/ins 1898 make changes to use sdk independently
([#6](#6))
([fbcda4f](fbcda4f))
* Namananand/ins 1899 auto gen protobuf related lib
([#5](#5))
([8e11663](8e11663))
* namananand/ins 1901 example documentation for sdk
([#3](#3))
([b7e6255](b7e6255))
* Namananand/ins 2172 update typescript sdk docs
([#18](#18))
([d72a505](d72a505))
* Namananand/ins 2172 update typescript sdk docs
([#19](#19))
([d0478ef](d0478ef))
* Namananand/ins 2172 update typescript sdk docs
([#20](#20))
([4961eaa](4961eaa))
* Namananand/ins 2172 update typescript sdk docs similar to the format
python sdk
([#17](#17))
([bcef664](bcef664))
* Namananand/ins 2235 update sdk docs for new refactor
([#24](#24))
([5143759](5143759))
* Namananand/ins 2251 separate queries mutation and actions for SDK and
example ([#38](#38))
([5ed98b1](5ed98b1))
* Namananand/ins 2271 update sdk params
([#28](#28))
([2079be3](2079be3))
* Namananand/ins 2271 update sdk params
([#29](#29))
([c21a9ef](c21a9ef))
* namananand/ins 3306 use new namespace from @instill-ai/typescript-sdk
--&gt; instill-sdk
([#54](#54))
([d7c29fd](d7c29fd))
* publish config changes
([#10](#10))
([e112705](e112705))
* refactor docs and remove unused files
([#23](#23))
([5a080e1](5a080e1))
* release version update
([#56](#56))
([c51c978](c51c978))
* update apiToken data type
([#35](#35))
([729d9a4](729d9a4))
* update client instance refactor
([#22](#22))
([d8aa4b7](d8aa4b7))
* update config of start operator
([#42](#42))
([c74ed31](c74ed31))
* update params name accessToken --&gt; apiToken
([#27](#27))
([046c5c0](046c5c0))
* update release command
([#12](#12))
([da1a73d](da1a73d))
* upgrade from v1alpha --&gt; v1beta
([#52](#52))
([5f5462c](5f5462c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant