# Developing mobile digital key applications with ClojureScript

**URL:** <https://forum.devtalk.com/t/developing-mobile-digital-key-applications-with-clojurescript/10017>\
**Category:** In The News\
**Tags:** mobile\
**Created:** [29 May 2021 21:26 UTC](https://forum.devtalk.com/t/developing-mobile-digital-key-applications-with-clojurescript/10017 "2021-05-29T21:26:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CommunityNews](https://forum.devtalk.com/user_avatar/forum.devtalk.com/communitynews/32/1113_2.png) [@CommunityNews](https://forum.devtalk.com/u/CommunityNews)\
**Post date:** [29 May 2021 21:26 UTC](https://forum.devtalk.com/t/developing-mobile-digital-key-applications-with-clojurescript/10017/1 "2021-05-29T21:26:26Z")

</div>

> Developing mobile digital key applications with ClojureScript - [vouch.io](http://vouch.io).  
> See how we use ClojureScript, React Native via Krell, and Storybook to manage complexity and improve workflow efficiency.

https://player.vimeo.com/video/552944121?app_id=122963

Read in full here:

> **[Developing mobile digital key applications with ClojureScript](https://vouch.io/developing-mobile-digital-key-applications-with-clojurescript/)**
>
> See how we use ClojureScript, React Native via Krell, and Storybook to manage complexity and improve workflow efficiency.

_This thread was posted by one of our members via one of our news source trackers._

---

<div class="post-metadata">

**Author:** ![DevotionGeo](https://forum.devtalk.com/user_avatar/forum.devtalk.com/devotiongeo/32/1140_2.png) [@DevotionGeo](https://forum.devtalk.com/u/DevotionGeo)\
**Post date:** [30 May 2021 07:33 UTC](https://forum.devtalk.com/t/developing-mobile-digital-key-applications-with-clojurescript/10017/3 "2021-05-30T07:33:13Z")

</div>

Wow, amazing!  
I don’t think it’ll take too much work to make ClojureScript work with NativeScript.

---

<div class="post-metadata">

**Author:** ![comfygenpvt](https://forum.devtalk.com/user_avatar/forum.devtalk.com/comfygenpvt/32/5641_2.png) [@comfygenpvt](https://forum.devtalk.com/u/comfygenpvt)\
**Post date:** [27 December 2023 13:27 UTC](https://forum.devtalk.com/t/developing-mobile-digital-key-applications-with-clojurescript/10017/4 "2023-12-27T13:27:16Z")

</div>

Creating a mobile digital key application involves various components, and writing a complete application here might be extensive. However, I can provide you with a simple example of a ClojureScript code snippet using a popular framework called Reagent. This example assumes a basic understanding of ClojureScript and assumes you have set up a ClojureScript project.

First, make sure you have Leiningen installed, which is a build tool for Clojure. Then, you can create a new ClojureScript project and include Reagent by following these steps:

Create a new project:

```auto
lein new figwheel my-mobile-key-app
cd my-mobile-key-app

```

Add Reagent as a dependency. Open `project.clj` and add the following to the dependencies:

```auto
:dependencies [[org.clojure/clojure "1.10.3"]
               [org.clojure/clojurescript "1.10.520"]
               [reagent "0.10.0"]]

```

Set up a basic Reagent component. Open `src/cljs/my_mobile_key_app/core.cljs` and replace its content with the following code:

```auto
(ns my-mobile-key-app.core
  (:require [reagent.core :as reagent]))

(defn digital-key-app []
  [:div
   [:h1 "Mobile Digital Key App"]
   [:p "Welcome to the digital key application!"]])

(defn ^:dev/after-load on-js-reload []
  (reagent/render [digital-key-app]
                  (.-app (.getElementById js/document "app"))))

(defn init! []
  (reagent/render [digital-key-app]
                  (.-app (.getElementById js/document "app"))))

```

Add an HTML file for rendering. Create an `index.html` file in the project root with the following content:

```auto
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Mobile Digital Key App</title>
</head>
<body>
  <div id="app"></div>
  <script src="js/compiled/my_mobile_key_app.js" type="text/javascript"></script>
  <script>my_mobile_key_app.core.init_BANG_();</script>
</body>
</html>

```

Start the Figwheel development server:

```auto
lein figwheel

```

This will compile your ClojureScript code and start a development server. Open your browser and navigate to [http://localhost:3449](http://localhost:3449), and you should see your basic mobile digital key app.
