<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Which javascript version on SDK?]]></title><description><![CDATA[<p dir="auto">I'm having some trouble building a basic script that sends sms alerts stored on the flichub.</p>
<p dir="auto">What javascript version is used in this environment for HBACE27-27526<br />
Firmware: 4.2.14</p>
]]></description><link>https://community.flic.io/topic/18388/which-javascript-version-on-sdk</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 08:35:56 GMT</lastBuildDate><atom:link href="https://community.flic.io/topic/18388.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Dec 2023 20:58:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Which javascript version on SDK? on Sat, 01 Jun 2024 19:43:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/5133">@gregor-vilkner</a> yes! Can you tell me a bit more about your use cases?</p>
]]></description><link>https://community.flic.io/post/21401</link><guid isPermaLink="true">https://community.flic.io/post/21401</guid><dc:creator><![CDATA[Emil]]></dc:creator><pubDate>Sat, 01 Jun 2024 19:43:43 GMT</pubDate></item><item><title><![CDATA[Reply to Which javascript version on SDK? on Sat, 01 Jun 2024 19:13:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/57">@Emil</a> fantastic! the other new sdk features will include twist support? we have lots of use cases where the twist would be dialed to coded manufacturing activities...</p>
]]></description><link>https://community.flic.io/post/21400</link><guid isPermaLink="true">https://community.flic.io/post/21400</guid><dc:creator><![CDATA[gregor.vilkner]]></dc:creator><pubDate>Sat, 01 Jun 2024 19:13:25 GMT</pubDate></item><item><title><![CDATA[Reply to Which javascript version on SDK? on Sat, 01 Jun 2024 12:58:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/5133">@gregor-vilkner</a> we are working on upgrading the JS engine to the newer QuickJS which has ES2023 support. Currently we are doing internal testing and will probably release it in a few months together with other new features to the hub sdk.</p>
]]></description><link>https://community.flic.io/post/21399</link><guid isPermaLink="true">https://community.flic.io/post/21399</guid><dc:creator><![CDATA[Emil]]></dc:creator><pubDate>Sat, 01 Jun 2024 12:58:29 GMT</pubDate></item><item><title><![CDATA[Reply to Which javascript version on SDK? on Fri, 31 May 2024 19:26:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/57">@Emil</a> a few "first flic-day" observations on this topic:</p>
<ul>
<li>
<p dir="auto">we're trying to integrate with a GraphQL api and need to turn all our beautiful queries into one-liners. is there no support for 'let', '``', multi-line text, and text substitutions?<br />
let query = <code>query q1{ heroes(name: ${someName}){   name   father{     name   } } }</code>;</p>
</li>
<li>
<p dir="auto">is there any async await way of doing web requests without call-back hell? it's like going back to 1998...</p>
</li>
<li>
<p dir="auto">no fetch?</p>
</li>
<li>
<p dir="auto">no atob(), no jwt decoding</p>
</li>
</ul>
<p dir="auto">function isTokenExpired(token) {<br />
if(token==null) return true;<br />
const arrayToken = token.split('.');<br />
const part2 = JSON.parse(new TextDecoder().decode(Duktape.dec('base64', arrayToken[1])));<br />
return Math.floor(new Date().getTime() / 1000) &gt;= part2.sub;<br />
}</p>
]]></description><link>https://community.flic.io/post/21398</link><guid isPermaLink="true">https://community.flic.io/post/21398</guid><dc:creator><![CDATA[gregor.vilkner]]></dc:creator><pubDate>Fri, 31 May 2024 19:26:33 GMT</pubDate></item><item><title><![CDATA[Reply to Which javascript version on SDK? on Thu, 21 Dec 2023 10:07:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/4964">@flic-16</a> said in <a href="/post/21099">Which javascript version on SDK?</a>:</p>
<p dir="auto"><code>Buffer.from</code> is a Node.js specific feature not present in any javascript/ecmascript standard.</p>
<p dir="auto">You can use <code>Duktape.enc('base64', 'some string')</code> instead to perform the Base64 encode.</p>
<p dir="auto">Like this:</p>
<pre><code class="language-javascript">const EncodedAuth = Duktape.enc('base64', 'abcd123:Password!');
</code></pre>
]]></description><link>https://community.flic.io/post/21100</link><guid isPermaLink="true">https://community.flic.io/post/21100</guid><dc:creator><![CDATA[Emil]]></dc:creator><pubDate>Thu, 21 Dec 2023 10:07:38 GMT</pubDate></item><item><title><![CDATA[Reply to Which javascript version on SDK? on Wed, 20 Dec 2023 20:41:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/57">@Emil</a> said in <a href="/post/21098">Which javascript version on SDK?</a>:</p>
<blockquote>
<p dir="auto">old javascript version</p>
</blockquote>
<p dir="auto">Is it possible to have a javascript in this environment send an SMS to the smsburst API?</p>
<p dir="auto">We have it working in other environments, but this one just doesnt seem to work.</p>
<pre><code>const http = require('http');

// Basic authentication credentials
const encodedAuth = Buffer.from('abcd123:Password123!').toString('base64');

// Setting up the headers for the request
const headers = {
    "Authorization": "Basic " + encodedAuth
};

// Message details
const message = encodeURIComponent("IVONNE: Testing from Flic SDK");
const to = encodeURIComponent("+16475551212");
const senderNumber = encodeURIComponent("18335551212");
const repliesToEmail = encodeURIComponent("email@example.com");

// Constructing the URL
const url = "https://api.transmitsms.com/send-sms.json?message=" + message + "&amp;to=" + to + "&amp;from=" + senderNumber + "&amp;replies_to_email=" + repliesToEmail;

// Making the HTTP request
function sendSmsViaTransmitSms() {
    console.log("Starting request to SMS Burst API...");

    http.makeRequest({
        url: url,
        method: 'POST',
        headers: headers
    }, function(error, result) {
        if (error) {
            console.error("An error occurred during the HTTP request:", error);
        } else {
            console.log("Received response from SMS Burst API");
            console.log("Response status code:", result.statusCode);
            console.log("Response headers:", result.headers);

            // Check if result.content exists and log it
            if (typeof result.content !== 'undefined') {
                console.log("Response body:", result.content);
            } else {
                console.log("Response body not available in this format");
            }
        }
    });
}

// Execute the function to send the SMS
sendSmsViaTransmitSms();
</code></pre>
<p dir="auto">Error is:</p>
<p dir="auto">TypeError: undefined not callable (property 'from' of [object Function])<br />
at [anon] (duk_js_call.c:2917) internal<br />
at [anon] (root/basicBurstSMSTest/main.js:1)<br />
at require (init.js:131)<br />
at [anon] (init.js:139) preventsyield<br />
at runInit () native strict preventsyield<br />
at handlePacket (pipe_communication.js:48)<br />
at readCallback (pipe_communication.js:93) preventsyield</p>
]]></description><link>https://community.flic.io/post/21099</link><guid isPermaLink="true">https://community.flic.io/post/21099</guid><dc:creator><![CDATA[flic 16]]></dc:creator><pubDate>Wed, 20 Dec 2023 20:41:21 GMT</pubDate></item><item><title><![CDATA[Reply to Which javascript version on SDK? on Tue, 19 Dec 2023 09:45:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/4964">@flic-16</a> currently we use <a href="https://duktape.org/" rel="nofollow ugc">https://duktape.org/</a> which implements a pretty old javascript version. We might upgrade in the future to an engine supporting a more modern javascript version.</p>
]]></description><link>https://community.flic.io/post/21098</link><guid isPermaLink="true">https://community.flic.io/post/21098</guid><dc:creator><![CDATA[Emil]]></dc:creator><pubDate>Tue, 19 Dec 2023 09:45:57 GMT</pubDate></item></channel></rss>