# Typescript version of the app api

**URL:** <https://discourse.sst.dev/t/typescript-version-of-the-app-api/279>\
**Category:** Site Feedback\
**Created:** [June 18, 2018, 2:19pm UTC](https://discourse.sst.dev/t/typescript-version-of-the-app-api/279 "2018-06-18T14:19:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vha14](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/vha14/32/141_2.png) [@vha14](https://discourse.sst.dev/u/vha14)\
**Post date:** [June 18, 2018, 2:19pm UTC](https://discourse.sst.dev/t/typescript-version-of-the-app-api/279/1 "2018-06-18T14:19:48Z")

</div>

I made a Typescript version [here](https://github.com/vha14/serverless-stack-demo-api-ts). Feedback and suggestions are welcome.

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [June 21, 2018, 5:25pm UTC](https://discourse.sst.dev/t/typescript-version-of-the-app-api/279/2 "2018-06-21T17:25:43Z")

</div>

@vha14 Oh that is awesome. Would you be interested in writing up the steps you took to set it up? I’d like to add an Extra Credit chapter for this.

---

<div class="post-metadata">

**Author:** ![vha14](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/vha14/32/141_2.png) [@vha14](https://discourse.sst.dev/u/vha14)\
**Post date:** [June 21, 2018, 11:25pm UTC](https://discourse.sst.dev/t/typescript-version-of-the-app-api/279/3 "2018-06-21T23:25:26Z")

</div>

- Update package.json:
  - Remove all babel related devDependencies and add typescript dependencies (@types/aws-lambda, @types/node, and @types/uuid, ts-loader, and typescript).
  - Remove babel-runtime and source-map-support from dependencies.

- Add [tsconfig.json](https://github.com/vha14/serverless-stack-demo-api-ts/blob/master/tsconfig.json).
- In webpack.config.js, update the devtool [line](https://github.com/vha14/serverless-stack-demo-api-ts/blob/master/webpack.config.js#L8) to enable source map support.
- In webpack.config.js, [update](https://github.com/vha14/serverless-stack-demo-api-ts/blob/master/webpack.config.js#L21-L23) the extension resolver to process .ts files.
- In webpack.config.js, [update](https://github.com/vha14/serverless-stack-demo-api-ts/blob/master/webpack.config.js#L28-L29) the test and the loader rules.
- Change all .js source code files to .ts extension.

You can now start using TypeScript features (see [example](https://github.com/vha14/serverless-stack-demo-api-ts/blob/master/libs/dynamodb-lib.ts#L3)).

---

<div class="post-metadata">

**Author:** ![vha14](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/vha14/32/141_2.png) [@vha14](https://discourse.sst.dev/u/vha14)\
**Post date:** [June 22, 2018, 4:00am UTC](https://discourse.sst.dev/t/typescript-version-of-the-app-api/279/4 "2018-06-22T04:00:16Z")

</div>

I also noted that the TypeScript lambda packages are about 56KB whereas the JavaScript with babel-runtime and source-map-support are 1.4MB.

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [June 22, 2018, 8:11pm UTC](https://discourse.sst.dev/t/typescript-version-of-the-app-api/279/5 "2018-06-22T20:11:31Z")

</div>

Thanks for this. I’m going to draft up a chapter on this soon. I’ll post it once I get a chance.

Or if you are interested in contributing it yourself, here are some instructions - [https://github.com/AnomalyInnovations/serverless-stack-com/blob/master/CONTRIBUTING.md#add-an-extra-credit-chapter](https://github.com/AnomalyInnovations/serverless-stack-com/blob/master/CONTRIBUTING.md#add-an-extra-credit-chapter). Let me know and I can help you get started.
