<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Joyce Lin</title>
    <description>The latest articles on DEV Community by Joyce Lin (@joycejetson).</description>
    <link>https://dev.to/joycejetson</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F118274%2F734c2d8a-a2cc-4203-90f4-0779dfdbf9a8.jpg</url>
      <title>DEV Community: Joyce Lin</title>
      <link>https://dev.to/joycejetson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joycejetson"/>
    <language>en</language>
    <item>
      <title>Build a fingerprint-controlled servo lock with Raspberry Pi</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Tue, 22 Jul 2025 22:12:26 +0000</pubDate>
      <link>https://dev.to/joycejetson/build-a-fingerprint-controlled-servo-lock-with-raspberry-pi-12ao</link>
      <guid>https://dev.to/joycejetson/build-a-fingerprint-controlled-servo-lock-with-raspberry-pi-12ao</guid>
      <description>&lt;p&gt;Create a secure, biometric access control system that unlocks a servo-powered latch when it detects an enrolled fingerprint. Perfect for geocache boxes, garage doors, or any physical access control application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12cpkndqp74q0h9pxo8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12cpkndqp74q0h9pxo8x.png" alt="Controlling servo through Viam web app"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What You'll Build
&lt;/h3&gt;

&lt;p&gt;A complete fingerprint authentication system using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;R503 fingerprint sensor for biometric scanning and enrollment&lt;/li&gt;
&lt;li&gt;Servo motor controlling a physical latch mechanism&lt;/li&gt;
&lt;li&gt;Raspberry Pi 4 running the Viam robotics server&lt;/li&gt;
&lt;li&gt;Custom control logic that triggers the servo when fingerprints match&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujgigrw7cmj9d4rgbjbh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujgigrw7cmj9d4rgbjbh.png" alt="Technical workflow diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fingerprint Management&lt;/strong&gt;: Enroll up to 200 different fingerprints across multiple slots, with support for enrolling the same finger multiple times to improve recognition reliability under varying angles and pressure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Latch Control&lt;/strong&gt;: Servo automatically moves to open position (180°) when authorized fingerprint detected, then returns to closed position (90°) after configurable timeout (default 30 seconds).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote Configuration&lt;/strong&gt;: Use Viam's web interface to test components, enroll new fingerprints via JSON commands, and monitor sensor readings in real-time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensible Design&lt;/strong&gt;: Build mobile or web apps using Viam's SDKs to create user-friendly enrollment interfaces for others to add their fingerprints.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hardware Requirements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Raspberry Pi 4 with USB flash drive&lt;/li&gt;
&lt;li&gt;R503 fingerprint sensor&lt;/li&gt;
&lt;li&gt;USB-to-serial adapter for sensor connectivity&lt;/li&gt;
&lt;li&gt;Servo motor (SG90 or similar)&lt;/li&gt;
&lt;li&gt;Jumper wires and connection materials&lt;/li&gt;
&lt;li&gt;Optional: 3D-printed or custom enclosure and latch mechanism&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3bkamk140b5442qaq00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3bkamk140b5442qaq00.png" alt="Fingerprint detected using sensor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Implementation Highlights
&lt;/h3&gt;

&lt;p&gt;The tutorial walks through complete setup including Raspberry Pi OS installation, SSH configuration, Viam platform setup, component wiring diagrams, and step-by-step fingerprint enrollment using JSON commands. The modular design separates sensor detection, servo control, and coordination logic for easy customization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ready to build your own biometric lock?&lt;/strong&gt; Follow the complete step-by-step tutorial 👉 &lt;a href="https://codelabs.viam.com/guide/fingerprint/index.html" rel="noopener noreferrer"&gt;Enable physical access using a fingerprint sensor&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/WFlZlPSefqc"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>programming</category>
      <category>automation</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How robots talk: building distributed robots with gRPC and WebRTC</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Fri, 20 Jun 2025 19:39:04 +0000</pubDate>
      <link>https://dev.to/joycejetson/how-robots-talk-building-distributed-robots-with-grpc-and-webrtc-3ehi</link>
      <guid>https://dev.to/joycejetson/how-robots-talk-building-distributed-robots-with-grpc-and-webrtc-3ehi</guid>
      <description>&lt;p&gt;👉 &lt;strong&gt;&lt;em&gt;&lt;a href="https://grpc.io/blog/robotics/" rel="noopener noreferrer"&gt;This article was originally published on the gRPC community blog&lt;/a&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’re building any kind of distributed machine, like robots, drones, or IoT devices, two questions come up fast:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How do you send structured commands and data efficiently?&lt;/li&gt;
&lt;li&gt;How do you keep communication resilient when you have an unreliable network?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, I’ll share the approach we use at &lt;a href="https://www.viam.com/" rel="noopener noreferrer"&gt;Viam&lt;/a&gt;, an open-source robotics platform that combines gRPC for structured RPCs and WebRTC for peer-to-peer streaming. Even if you’re not building robots, the same architectural ideas can help you design more scalable and adaptable systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bridging the gap between lab-grade robotics and real-world systems
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Robot_Operating_System" rel="noopener noreferrer"&gt;ROS&lt;/a&gt; (Robot Operating System) has long been the go-to framework for building and prototyping robotics systems, especially in research and academia. It works well on trusted, local networks because that’s what it was designed for.&lt;/p&gt;

&lt;p&gt;But today’s robots don’t stay on tightly-regulated lab benches. They’re deployed on factory floors, out at sea, or in remote fields, where network conditions are unpredictable and reliability matters.&lt;/p&gt;

&lt;p&gt;ROS doesn’t handle network communication out of the box. If you need to talk to a robot over the internet, you’re on your own to architect the solution. Modern robotics requires more than local LAN protocols. It needs cloud-ready, peer-to-peer, resilient communication stacks.&lt;/p&gt;

&lt;p&gt;Rather than relying on a distributed messaging stack like MQTT or relaying commands through the cloud, Viam uses gRPC and WebRTC to power &lt;a href="https://docs.viam.com/#platform" rel="noopener noreferrer"&gt;its robotics platform&lt;/a&gt;. Used together, these protocols offer a modern alternative that complements ROS’s strengths. gRPC provides structured, language-agnostic APIs with fast, efficient Protobuf serialization. And WebRTC adds low-latency, peer-to-peer connections, which is ideal for streaming sensor data or real-time video between machines.&lt;/p&gt;

&lt;p&gt;Some robot builders are also layering gRPC interfaces on top of ROS, blending ROS’s rich ecosystem with the modern transport and scalability of gRPC.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why gRPC makes sense for robots
&lt;/h2&gt;

&lt;p&gt;Modern robots are no longer single-purpose machines in fixed environments. They’re mobile, multi-part systems that need to collaborate with sensors, perception services, and control loops, often in real time.&lt;/p&gt;

&lt;p&gt;gRPC supports these needs in several key ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Low-latency, real-time control&lt;/strong&gt;: gRPC enables continuous, bidirectional streams, allowing systems to send real-time pose updates to a robotic arm, while simultaneously receiving telemetry, without additional round-trip delays.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-platform, multi-language consistency&lt;/strong&gt;: gRPC automatically generates client libraries (stubs) for languages like Python, Go, C++, and others, making it easier to bridge different devices, SDKs, and environments with a consistent interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lightweight and efficient serialization&lt;/strong&gt;: gRPC also helps in bandwidth-constrained environments or on embedded devices, enabled by Protobuf’s lightweight binary encoding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security benefits&lt;/strong&gt;: gRPC is designed with end-to-end encryption (TLS by default) and authentication capabilities baked in, ensuring secure communication between machine parts, whether across local networks or the public internet, without requiring developers to bolt on separate security layers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service abstraction for machine parts&lt;/strong&gt;: With gRPC and Protobuf, every part of a robot, from motors to cameras to sensors, can be modeled as a standardized, language-agnostic service. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprh0tcm6rf1bf6o0a48p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprh0tcm6rf1bf6o0a48p.png" alt="Every robot part becomes an encapsulated, language-agnostic service" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://github.com/viamrobotics/api" rel="noopener noreferrer"&gt;Viam’s public API&lt;/a&gt;, each robot component is defined as a gRPC service using Protobuf. Components like arms, cameras, and sensors expose typed methods that can be called remotely. Here’s an excerpt from the &lt;a href="https://github.com/viamrobotics/api/blob/main/proto/viam/component/arm/v1/arm.proto" rel="noopener noreferrer"&gt;arm.proto&lt;/a&gt; file that defines basic movement and pose retrieval methods for a robotic arm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// An ArmService services all arms associated with a robot
service ArmService {
  rpc MoveToPosition (MoveToPositionRequest) returns (MoveToPositionResponse);
  rpc GetEndPosition (GetEndPositionRequest) returns (GetEndPositionResponse);
  rpc GetJointPositions(GetJointPositionsRequest) returns (GetJointPositionsResponse);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These proto services can then generate &lt;a href="https://docs.viam.com/dev/reference/sdks/" rel="noopener noreferrer"&gt;SDKs&lt;/a&gt; to help you work with your machines. This example uses the Python SDK to move an arm. Under the hood, gRPC handles encoding the command into a Protobuf message and sending it over HTTP/2 (or WebRTC, depending on the environment).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from viam.components.arm import ArmClient

arm = ArmClient.from_robot(robot=robot, name="my-arm")

# Move the arm to a target 3D position
arm.move_to_position(x=0.1, y=0.2, z=0.3, orientation=None, world_state=None)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why WebRTC is also part of the picture
&lt;/h2&gt;

&lt;p&gt;At first glance, gRPC and WebRTC might seem redundant. Both can stream data and send structured messages. But they solve very different challenges in robotics.&lt;/p&gt;

&lt;p&gt;WebRTC excels at direct, peer-to-peer connections, which is essential when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Devices are on local networks or constrained by NAT/firewalls&lt;/li&gt;
&lt;li&gt;You want to bypass a central relay or cloud server&lt;/li&gt;
&lt;li&gt;You’re streaming high-bandwidth sensor data (like real-time video or LIDAR) between machines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Viam uses gRPC for orchestration and WebRTC as the underlying transport, combining them for fast, structured messaging with minimal routing overhead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flexible transport layers with gRPC
&lt;/h2&gt;

&lt;p&gt;While WebRTC enables peer-to-peer communication in distributed machines, gRPC also offers flexibility to swap underlying transport layers.&lt;/p&gt;

&lt;p&gt;Here is &lt;a href="https://github.com/viamrobotics/goutils/tree/main/rpc/examples/echo" rel="noopener noreferrer"&gt;an example gRPC server that runs over WebRTC and other transport protocols&lt;/a&gt;. Viam also uses Unix domain sockets (UDS) for local messaging between the &lt;code&gt;viam-server&lt;/code&gt; and internal modules, Bluetooth for provisioning machines or proxying network traffic, and serial ports for embedded peripherals.&lt;/p&gt;

&lt;p&gt;Because gRPC defines a consistent interface at the API layer, we can change the transport depending on the environment or device without rewriting client logic, a huge strength when building systems that span cloud, local, and constrained networks.&lt;/p&gt;

&lt;h2&gt;
  
  
  A real-world example: coordinating a claw game
&lt;/h2&gt;

&lt;p&gt;Picture a remote-controlled claw machine, like the ones you’d find in an arcade. It has two main components: a camera and a robotic arm. A user interface, such as a &lt;a href="https://docs.viam.com/dev/reference/sdks/#frontend-sdks" rel="noopener noreferrer"&gt;web app&lt;/a&gt; or &lt;a href="https://docs.viam.com/dev/reference/sdks/#mobile-sdk" rel="noopener noreferrer"&gt;mobile app&lt;/a&gt;, sends control commands and receives a live video stream to help guide the claw to its prize.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6yuf3ghe84mo9l3oprcd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6yuf3ghe84mo9l3oprcd.png" alt="Viam enclosed robotic arm as a claw game at a conference" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here’s how gRPC and WebRTC work together behind the scenes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Initialization&lt;/strong&gt;: The system establishes control channels using gRPC over HTTP/2. Each component registers its services (e.g. ArmService, CameraService).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Connection&lt;/strong&gt;: gRPC coordinates the exchange of peer metadata and signaling to set up a WebRTC session between the SDK and machine parts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time operation&lt;/strong&gt;: WebRTC now handles the media and data streams directly between peers. Commands are sent using gRPC method calls, routed over the WebRTC transport. Video and sensor streams flow the other way.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyyozcksljj9fu5l5m4tw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyyozcksljj9fu5l5m4tw.png" alt="Viam uses gRPC to initialize connections and WebRTC for peer-to-peer communication in this robot claw game" width="800" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This dual-protocol approach allows real-time interaction, smooth streaming, and resilient fallback behavior, even in unpredictable network conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this pattern matters for the broader community
&lt;/h2&gt;

&lt;p&gt;The combination of gRPC’s structure and WebRTC’s flexibility opens the door to a new class of distributed systems, not just in robotics, but anywhere you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time, bi-directional communication between loosely-coupled systems&lt;/li&gt;
&lt;li&gt;Typed, versioned APIs that span languages and devices&lt;/li&gt;
&lt;li&gt;Transport-agnostic flexibility, with the option to go peer-to-peer when needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;gRPC structures the conversation. WebRTC carries it across the network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viam for real-time robot control
&lt;/h2&gt;

&lt;p&gt;gRPC has evolved far beyond simple request/response APIs. Across many industries beyond robotics, the way machines communicate is more critical than ever. gRPC and WebRTC aren’t just faster protocols, they’re influential building blocks for the next generation of distributed, resilient, and intelligent machines.&lt;/p&gt;

&lt;p&gt;If you’re building systems that need to talk to each other across devices, environments, and networks, it might be time to explore a more scalable and adaptable communication layer.&lt;/p&gt;

&lt;p&gt;While you could engineer a similar stack on your own, &lt;a href="https://www.viam.com/" rel="noopener noreferrer"&gt;Viam&lt;/a&gt; offers these capabilities out of the box. The on-machine functionality is open-source and free to operate, with optional cloud services available on a usage-based model when you scale to fleets.&lt;/p&gt;

&lt;p&gt;Technical review by &lt;a class="mentioned-user" href="https://dev.to/hipsterbrown"&gt;@hipsterbrown&lt;/a&gt; (Viam) &lt;/p&gt;

</description>
      <category>robotics</category>
      <category>distributedsystems</category>
    </item>
    <item>
      <title>When Code Meets Reality: Lessons from Building in the Physical World</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Thu, 10 Apr 2025 14:04:02 +0000</pubDate>
      <link>https://dev.to/joycejetson/when-code-meets-reality-lessons-from-building-in-the-physical-world-3pia</link>
      <guid>https://dev.to/joycejetson/when-code-meets-reality-lessons-from-building-in-the-physical-world-3pia</guid>
      <description>&lt;p&gt;As web developers, we get a lot of things for free: controlled environments, predictable inputs, and tight feedback loops. Testing, monitoring, and CI/CD pipelines help us catch and recover from failure quickly. But once code steps off the screen and into the physical world, you give up some control.&lt;/p&gt;

&lt;p&gt;Check out my lightning talk at DotJS about how &lt;strong&gt;&lt;a href="https://youtu.be/7zXL6YIBv2c?feature=shared" rel="noopener noreferrer"&gt;Code in the Physical World&lt;/a&gt;&lt;/strong&gt; can get a little messy.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/7zXL6YIBv2c"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The good news? You don’t need to throw out your existing skillset to ride the wave of bringing AI into the physical world. The foundations you already have in web development translate more than you might think.&lt;/p&gt;

&lt;p&gt;At &lt;a href="https://docs.viam.com/?utm_source=referral&amp;amp;utm_medium=referral&amp;amp;utm_campaign=vmrk-joyce-general-general-blog-dotjs&amp;amp;utm_content=lp_docs" rel="noopener noreferrer"&gt;Viam&lt;/a&gt;, we build open-source tools that connect software to hardware. That means robotics, IoT, and edge computing. It’s fun, powerful…and deeply humbling. Because no matter how clean your code is, reality doesn’t always play along. &lt;/p&gt;

&lt;h2&gt;
  
  
  Failure Looks Different in the Physical World
&lt;/h2&gt;

&lt;p&gt;Compared to software development environments, physical environments face different challenges that result in different consequences.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rivian pushed an OTA update that &lt;a href="https://www.reddit.com/r/Rivian/comments/17usikn/202342_ota_update_issue/" rel="noopener noreferrer"&gt;bricked 3% of their fleet&lt;/a&gt;, all because someone selected the wrong security certificate.&lt;/li&gt;
&lt;li&gt;A Nest thermostat update &lt;a href="https://www.bbc.com/news/technology-35311447" rel="noopener noreferrer"&gt;crashed during a winter update rollout&lt;/a&gt; because no one accounted for unstable networks.&lt;/li&gt;
&lt;li&gt;Facebook suffered a &lt;a href="https://en.wikipedia.org/wiki/2021_Facebook_outage" rel="noopener noreferrer"&gt;6-hour global outage&lt;/a&gt; after a configuration change took down their internal tools and locked engineers out of data centers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike web apps, a failed update in physical systems can’t be fixed with a quick deploy. In the physical world, failure is a car that won’t start, a house without heat, or engineers with crowbars trying to get back into their own data centers.&lt;/p&gt;

&lt;p&gt;And it’s not just human error:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cables melt under AI inference loads when &lt;a href="https://arstechnica.com/gadgets/2025/02/handful-of-users-claim-new-nvidia-gpus-are-melting-power-cables-again/" rel="noopener noreferrer"&gt;NVIDIA sourced power cables&lt;/a&gt; that were not well-rated for the intensive operations to support AI pipelines.&lt;/li&gt;
&lt;li&gt;Sensors drift over time due to dust, aging, and other environmental factors, one reason why &lt;a href="https://www.airgradient.com/blog/air-quality-monitor-review-guidelines/" rel="noopener noreferrer"&gt;AirGradient recalibrates and smooths the detected values&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Connectivity is intermittent by design, like &lt;a href="https://en.wikipedia.org/wiki/MQTT#:~:text=It%20was%20used%20to%20monitor,extremely%20expensive%20at%20that%20time." rel="noopener noreferrer"&gt;MQTT for oil pipelines&lt;/a&gt; and &lt;a href="https://conserveturtles.org/project/sea-turtle-tracking/" rel="noopener noreferrer"&gt;sea turtles tagged with satellite sensors&lt;/a&gt; to store and forward data upon surfacing when connection is re-established.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53sethsai7jhrwzy2wxm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53sethsai7jhrwzy2wxm.png" alt="Buckley the sea turtle being tracked with a satellite tag"&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://conserveturtles.org/turtle/buckley/" rel="noopener noreferrer"&gt;Buckley the sea turtle&lt;/a&gt; being tracked with a satellite tag
  &lt;/p&gt;

&lt;h2&gt;
  
  
  So What Can Developers Do?
&lt;/h2&gt;

&lt;p&gt;We can’t count on eliminating failure altogether, but we can plan for it. Just like we design UIs for low-bandwidth conditions or fallback states, physical systems need graceful failure modes too.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your phone doesn’t catch fire when it overheats, it throttles the CPU, dims the screen, and pauses charging. That’s a designed failure state.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.jpl.nasa.gov/edu/resources/teachable-moment/the-voyagers-are-still-exploring-40-years-later/" rel="noopener noreferrer"&gt;NASA’s Voyager 1&lt;/a&gt; is still running almost 50 years later without the ability to physically replace components. This is largely due to careful planning for failovers, redundancy, and managing tradeoffs.&lt;/li&gt;
&lt;li&gt;Starlink satellites are designed to be safely decommissioned and &lt;a href="https://www.starlink.com/public-files/Starlink_Approach_to_Satellite_Demisability.pdf" rel="noopener noreferrer"&gt;burn up cleanly at end-of-life&lt;/a&gt; leaving no debris in space.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you build for the physical world, failure is expected. The goal isn’t to prevent it, it’s to control how it happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing Code That Controls Hardware
&lt;/h2&gt;

&lt;p&gt;You shouldn’t need to write firmware or low-level code to build real-world systems. That’s where projects like &lt;a href="https://embedded.js.org/" rel="noopener noreferrer"&gt;TC53&lt;/a&gt; come in, standardizing JavaScript APIs for physical devices.&lt;/p&gt;

&lt;p&gt;Even moreso, you don’t need to write code that runs on the device, you can write code that controls the device remotely. If you’ve worked with REST APIs, event handlers, or browser-based tools, transitioning from purely digital interfaces to code that interacts with hardware is more familiar than you might expect.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://webrtc.org/" rel="noopener noreferrer"&gt;WebRTC&lt;/a&gt;&lt;/strong&gt;: With browser-native APIs like WebRTC, you can control a physical device from your browser. No code needs to be deployed to the device itself. 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzvkycq4obpdzy8m45e6x.png" alt="Technical diagram of using a browser to remotely control a Raspberry Pi"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://johnny-five.io/" rel="noopener noreferrer"&gt;Johnny-Five&lt;/a&gt;&lt;/strong&gt;: This is a framework that lets you run Node.js on your laptop to talk to an Arduino board over serial like a remote control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.viam.com/?utm_source=referral&amp;amp;utm_medium=referral&amp;amp;utm_campaign=vmrk-joyce-general-general-blog-dotjs&amp;amp;utm_content=lp_docs" rel="noopener noreferrer"&gt;Viam&lt;/a&gt;&lt;/strong&gt;: This is an open-source platform that abstracts away the finer details of integrating with drivers, networking, and security. So you can plug-and-play with modules to create your dream machines and then use the SDKs to build applications that control them.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fek31osju07yzfozjnxxf.png" alt="Diagram of Viam architecture"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The real lesson? Keep the logic where it's easy to test, debug, and update. In this way, we can leverage our existing skillset to control devices without needing to dive deep into low-level code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Shift Toward Embodied AI
&lt;/h2&gt;

&lt;p&gt;We’ve had the fundamental technologies for quite a while - computer vision, robot vacuums, Mars rovers that execute pre-planned logic. So what’s different now to enable the wild growth in AI, beyond the world of software, and into the physical world? &lt;/p&gt;

&lt;p&gt;What’s changed? Three key things have made embodied AI possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Low-cost, high-performance compute&lt;/li&gt;
&lt;li&gt;Tooling and ecosystem to support deploying models and managing fleets&lt;/li&gt;
&lt;li&gt;Enough training data to go from rule-based execution to on-the-fly learning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That unlocks a huge shift to enable systems that sense, act, adapt, and recover, just like people.&lt;/p&gt;

&lt;p&gt;And we’re not just shipping to the cloud anymore. We’re shipping to physical devices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Phones&lt;/li&gt;
&lt;li&gt;Wearables&lt;/li&gt;
&lt;li&gt;Cars&lt;/li&gt;
&lt;li&gt;Drones&lt;/li&gt;
&lt;li&gt;Robots&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The boundary between code and the real world is disappearing. And that’s why this moment is so exciting for web developers. Web developers have a unique advantage here. The shift to client-side AI and edge compute means your skills are in demand in this new landscape. &lt;/p&gt;

&lt;h2&gt;
  
  
  Want to Try It Yourself?
&lt;/h2&gt;

&lt;p&gt;Modern platforms like Viam make it possible to control real-world hardware using familiar tools like JavaScript, Python, and APIs. &lt;/p&gt;

&lt;p&gt;If you're curious about working with real-world hardware using modern software tools, check out &lt;a href="https://docs.viam.com/?utm_source=referral&amp;amp;utm_medium=referral&amp;amp;utm_campaign=vmrk-joyce-general-general-blog-dotjs&amp;amp;utm_content=lp_docs" rel="noopener noreferrer"&gt;the Viam docs&lt;/a&gt;. You don’t need to be an embedded systems engineer, just someone who understands how systems interact and wants to see it move something in the real world.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwox1vccb514ua8526g3x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwox1vccb514ua8526g3x.png" alt="Robot arm pouring water into a glass"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>robotics</category>
      <category>iot</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Powering home automation with WebSocket APIs</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Thu, 06 Jul 2023 15:08:43 +0000</pubDate>
      <link>https://dev.to/postman/powering-home-automation-with-websocket-apis-3mm0</link>
      <guid>https://dev.to/postman/powering-home-automation-with-websocket-apis-3mm0</guid>
      <description>&lt;p&gt;In Part 1 of this series, we learned about the &lt;a href="https://learning.postman.com/docs/sending-requests/websocket/websocket/" rel="noopener noreferrer"&gt;WebSocket&lt;/a&gt; protocol and how to &lt;a href="https://dev.to/mjgutermuth/set-up-a-websockets-server-in-nodejs-ka6-temp-slug-6897606"&gt;set up our own WebSocket server in Node.js&lt;/a&gt;. Next, let’s explore how to use a public WebSocket API to access smart devices around a connected home.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ljbxngbdxrpw1832ug1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ljbxngbdxrpw1832ug1.jpg" alt="Illustration of home iot devices"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  REST and WebSockets for a connected home
&lt;/h2&gt;

&lt;p&gt;When it comes to transmitting data in a connected home environment, both &lt;a href="https://dev.to/jansche/what-is-a-rest-api-examples-uses-and-challenges-8k3-temp-slug-6487224"&gt;REST&lt;/a&gt; and WebSockets are commonly used protocols, but they have different characteristics and use cases.&lt;/p&gt;

&lt;p&gt;REST follows a request-response pattern, where a client sends a request to a server, and the server responds with the requested data. This is useful for accessing and controlling smart devices and services, and works well for scenarios where data updates are not required in real-time. For example, you could use a REST API to turn on a smart light.&lt;/p&gt;

&lt;p&gt;On the other hand, WebSockets enables bidirectional communication between a client and server, enabling real-time data transmission. This is useful for applications that require continuous data updates, such as real-time monitoring of sensor data and displaying live dashboards. For example, you could use a WebSocket API to continuously monitor the temperature in a room over a persistent connection.&lt;/p&gt;

&lt;p&gt;In the next section, let’s take a look at a popular home automation platform that provides both REST and WebSocket APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Home Assistant for home automation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.home-assistant.io/" rel="noopener noreferrer"&gt;Home Assistant&lt;/a&gt; is a popular open-source home automation platform that lets you control and monitor smart devices from different brands using a unified interface. Instead of using separate applications to control the kitchen lights, thermostat, and other connected devices all manufactured by different producers, you can manage almost everything from a single Home Assistant web dashboard running on a Raspberry Pi or other dedicated server within your local network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F06%2Fimage1-3-1000x613.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F06%2Fimage1-3-1000x613.png" alt="Home Assistant progressive web application running at http://homeassistant.local:8123"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Home Assistant progressive web application running at &lt;a href="http://homeassistant.local:8123" rel="noopener noreferrer"&gt;http://homeassistant.local:8123&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Home Assistant is ideal for DIY smart-home tinkerers because it supports a wide range of integrations and protocols, allowing you to customize automation scenarios based on events, schedules, and sensor readings.&lt;/p&gt;

&lt;p&gt;Next, let’s take a look at Home Assistant’s WebSocket API.&lt;/p&gt;
&lt;h2&gt;
  
  
  Home Assistant WebSocket API
&lt;/h2&gt;

&lt;p&gt;In addition to a &lt;a href="https://developers.home-assistant.io/docs/api/rest/" rel="noopener noreferrer"&gt;REST API&lt;/a&gt;&lt;a href="https://blog.postman.com/rest-api-examples" rel="noopener noreferrer"&gt;,&lt;/a&gt; Home Assistant also contains a &lt;a href="https://developers.home-assistant.io/docs/api/websocket" rel="noopener noreferrer"&gt; WebSocket API&lt;/a&gt; to stream information. To learn how to authenticate the WebSockets connection and send saved messages to the Home Assistant server, follow along with this &lt;a href="https://quickstarts.postman.com/guide/home-assistant/index.html?index=..%2F..index#0" rel="noopener noreferrer"&gt;step-by-step tutorial&lt;/a&gt;, watch the &lt;a href="https://youtu.be/Qk9A0QbG5-I" rel="noopener noreferrer"&gt;video&lt;/a&gt;, and reference &lt;a href="https://www.postman.com/postman/workspace/program-smart-lights/collection/6481ed9afe7f1bdfaa732408" rel="noopener noreferrer"&gt;the sample collection&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Qk9A0QbG5-I"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Using a long-lived token, you can use Postman to establish a connection with our Home Assistant server running locally, and then send and receive messages using the WebSocket API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F06%2Fimage2-3-1000x648.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F06%2Fimage2-3-1000x648.png" alt="Saved messages to replay common scenarios"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Receive a stream of information when the state changes on any device connected to Home Assistant&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You can also configure your own &lt;strong&gt;Saved Messages&lt;/strong&gt; to create your own customized themes and sequences.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F06%2Fimage3-1-1000x734.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F06%2Fimage3-1-1000x734.png" alt="Saved messages to replay common scenarios"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Saved messages to replay common scenarios&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Home Assistant also provides a &lt;a href="https://developers.home-assistant.io/docs/api/rest" rel="noopener noreferrer"&gt;REST API&lt;/a&gt;. Explore Home Assistant’s WebSocket and REST APIs side-by-side in Postman to better understand the differences between the two protocols.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional resources
&lt;/h2&gt;

&lt;p&gt;You can work in Postman using different API patterns and protocols. Check out these Postman resources to learn more about WebSockets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/postman/workspace/websockets/documentation/14057978-712d684f-c252-4bd9-a7a6-6a893e41adea" rel="noopener noreferrer"&gt;Guide to Postman WebSockets&lt;/a&gt; collection&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://learning.postman.com/docs/sending-requests/websocket/websocket/" rel="noopener noreferrer"&gt;Using WebSocket requests&lt;/a&gt; docs&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://youtu.be/H-7EZVj9D-k" rel="noopener noreferrer"&gt;WebSocket requests&lt;/a&gt; video&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Browse the &lt;a href="https://www.postman.com/postman/workspace/program-smart-lights/overview" rel="noopener noreferrer"&gt;Program smart lights&lt;/a&gt; public workspace for APIs from other providers, such as Philips Hue and Elgato, to automatically control smart lights in your home or office. And let us know in the comments below what kind of projects you want to learn about, and what you’re doing with WebSockets.&lt;/p&gt;



&lt;p&gt;The post &lt;a href="https://dev.to/jansche/powering-home-automation-with-websocket-apis-3k15-temp-slug-8844498"&gt;Powering home automation with WebSocket APIs&lt;/a&gt; appeared first on &lt;a href="https://blog.postman.com" rel="noopener noreferrer"&gt;Postman Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>editorspicks</category>
      <category>general</category>
      <category>automation</category>
      <category>iot</category>
    </item>
    <item>
      <title>Create Reusable Tests and Scripts with OpenAPI Reusable Components</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Thu, 09 Feb 2023 18:34:11 +0000</pubDate>
      <link>https://dev.to/joycejetson/create-reusable-tests-and-scripts-with-openapi-reusable-components-2bpp</link>
      <guid>https://dev.to/joycejetson/create-reusable-tests-and-scripts-with-openapi-reusable-components-2bpp</guid>
      <description>&lt;p&gt;In programming, “hacking” has historically meant making something do what it wasn’t originally intended to do, like &lt;a href="https://www.popularmechanics.com/technology/a20762221/an-early-hacker-used-a-cereal-box-whistle-to-take-over-phone-lines/" rel="noopener noreferrer"&gt;using a whistle from a cereal box prize&lt;/a&gt; to play the tone into a pay phone to get free long distance calls. Today, it also refers to finding an inelegant solution to a problem. The word has gotten a bad rap, since it typically implies a nefarious or criminal activity. But many companies offer public APIs, empowering developers to stitch together their own customized solutions, even if the workarounds are a bit of a “hack.”&lt;/p&gt;

&lt;p&gt;For example, if the user interface doesn’t accommodate a specific use case, and you can’t control which features get released and when, it’s time to get resourceful. APIs are an opportunity to create a workaround that suits you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alternative solutions for reusable tests and scripts
&lt;/h2&gt;

&lt;p&gt;Postman users have asked if it’s possible to reuse tests and scripts. There isn’t a button or section in Postman that says, “Store your own reusable scripts here,” but there are many ways to accomplish this.&lt;/p&gt;

&lt;p&gt;Some alternative solutions that might work for your particular circumstances are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://learning.postman.com/docs/writing-scripts/intro-to-scripts/#execution-order-of-scripts" rel="noopener noreferrer"&gt;Creating collection-level or folder-level scripts&lt;/a&gt; to run with every request within the collection or folder.&lt;/li&gt;
&lt;li&gt;Storing scripts in a &lt;a href="https://learning.postman.com/docs/sending-requests/variables/#variable-scopes" rel="noopener noreferrer"&gt;global variable&lt;/a&gt; to use within the &lt;a href="https://dev.to/jansche/solving-problems-together-with-postman-workspaces-16hk-temp-slug-6231202"&gt;workspace.&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Storing scripts in an environment variable to use alongside different collections.&lt;/li&gt;
&lt;li&gt;Setting utility functions using any scope of Postman variables at the beginning of the collection, which can then be used throughout the collection.&lt;/li&gt;
&lt;li&gt;Accessing your local file system for scripts saved on your machine.&lt;/li&gt;
&lt;li&gt;Storing scripts within reusable components in an OpenAPI definition.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we’ll explore the last option in more detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Storing scripts within reusable components in OpenAPI
&lt;/h2&gt;

&lt;p&gt;OpenAPI is the most popular API definition format that’s driving &lt;a href="https://www.postman.com/api-first/" rel="noopener noreferrer"&gt;the API-first trend&lt;/a&gt;. Reusable components in OpenAPI are a powerful feature in designing and documenting an API. We won’t explore this capability now, but if you’re interested in learning more about it, check out &lt;a href="https://youtu.be/YRzpziA35Mg?t=1696" rel="noopener noreferrer"&gt;an example of re-using an error schema&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this article, we rely on reusable components to store our scripts and tests, and then use the Postman API to retrieve them when they’re needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsb9185bl9m8nzvibwy3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsb9185bl9m8nzvibwy3t.png" alt="create scripts in OpenAPI reusable components and reference the scripts within a collection" width="800" height="413"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Create scripts in OpenAPI reusable components and reference the scripts within a collection.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create the script
&lt;/h3&gt;

&lt;p&gt;Let’s save our script within a custom component in our API definition.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://learning.postman.com/docs/designing-and-developing-your-api/creating-an-api/" rel="noopener noreferrer"&gt;&lt;strong&gt;Create an API definition&lt;/strong&gt;&lt;/a&gt;: In Postman, select &lt;strong&gt;APIs&lt;/strong&gt; in the sidebar, and then select &lt;strong&gt;+&lt;/strong&gt;. Enter a name for your new API, and continue without a repository. Create a new API definition for your API, and author the definition from scratch. Configure the definition as &lt;code&gt;OpenAPI 3.0&lt;/code&gt;, &lt;code&gt;YAML&lt;/code&gt; format, and check the option to &lt;code&gt;Use a boilerplate (predefined template)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create custom components:&lt;/strong&gt; Within the generated file called &lt;code&gt;index.yaml&lt;/code&gt;, scroll down to the section called &lt;code&gt;components&lt;/code&gt;. Create a custom component under &lt;code&gt;components&lt;/code&gt; that begins with an &lt;code&gt;x-&lt;/code&gt; prefix. Add the name of your script, test, or any other data you want to store. Add a description that is the code you want to store as text for each component. See rows 38 to 49 in &lt;a href="https://www.postman.com/postman/workspace/postman-answers/api/5a01c61f-e5e1-4876-bde6-0c7c924e8282/version/3a97617a-c592-4f12-a766-fde92905d39b?tab=define" rel="noopener noreferrer"&gt;this example&lt;/a&gt;. Optionally, add a type or other metadata that is used to remind readers and yourself about this code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K52BPnH1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image2-6-1000x640.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K52BPnH1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image2-6-1000x640.png" alt="Create custom components using an  raw `x-` endraw  prefix" width="800" height="512"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Create custom components using an x- prefix.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Reference the script
&lt;/h3&gt;

&lt;p&gt;Let’s retrieve the custom script and execute it in a request script.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enable YAML parsing&lt;/strong&gt; : Store the source code for &lt;a href="https://www.npmjs.com/package/js-yaml" rel="noopener noreferrer"&gt;this YAML parser for JavaScript&lt;/a&gt; in a &lt;a href="https://learning.postman.com/docs/sending-requests/managing-environments/" rel="noopener noreferrer"&gt;global variable&lt;/a&gt; called &lt;code&gt;yaml-js&lt;/code&gt;. In other words, copy and paste &lt;a href="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.13.1/js-yaml.js" rel="noopener noreferrer"&gt;this code&lt;/a&gt; into the global variables editor:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8b8aLgOh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image5-4-1000x534.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8b8aLgOh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image5-4-1000x534.png" alt="Store source code of external library as a global variable so it can be used in a Postman script" width="800" height="427"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Store source code of external library as a global variable so it can be used in a Postman script.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Then, under the &lt;strong&gt;Tests&lt;/strong&gt; tab of the request, import &lt;code&gt;yaml-js&lt;/code&gt; so that it can be used within the script:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nP014Bz_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image4-5-1000x155.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nP014Bz_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image4-5-1000x155.png" alt="Import  raw `yaml-js` endraw  so it can be used within the script." width="800" height="124"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Import yaml-js so it can be used within the script.&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve the API definition&lt;/strong&gt; : Use &lt;a href="https://learning.postman.com/docs/sending-requests/grpc/postman-sandbox-api/#sending-http-request-from-scripts" rel="noopener noreferrer"&gt;&lt;code&gt;pm.sendRequest()&lt;/code&gt;&lt;/a&gt; to &lt;a href="https://www.postman.com/postman/workspace/postman-public-workspace/request/12959542-748c0367-6e64-4b9c-9f02-a2b8d297dc38" rel="noopener noreferrer"&gt;retrieve our API definition using the Postman API&lt;/a&gt; created in the previous steps. The example in the screenshot below shows the &lt;code&gt;apiId&lt;/code&gt; and &lt;code&gt;postman-api-key&lt;/code&gt; stored as collection variables.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iZjtxRJ5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image6-4-1000x386.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iZjtxRJ5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image6-4-1000x386.png" alt="Use  raw `pm.sendRequest()` endraw  to retrieve the API definition." width="800" height="309"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Use pm.sendRequest() to retrieve the API definition.&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use the reusable components:&lt;/strong&gt;   Once we retrieve the reusable components from the API definition, we can use a function like &lt;code&gt;eval()&lt;/code&gt; to evaluate JavaScript code represented as a string. &lt;strong&gt;Note&lt;/strong&gt; : there is &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval!" rel="noopener noreferrer"&gt;a big security risk in using &lt;code&gt;eval()&lt;/code&gt;&lt;/a&gt;, so make sure you know what code you are running.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PVXG5SSj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image1-6-1000x640.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PVXG5SSj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2023/01/image1-6-1000x640.png" alt="Confirm the scripts work as expected, such as logging to the console, running a test, and incrementing an integer." width="800" height="512"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Confirm the scripts do what you expect, such as logging to the console, running a test, and incrementing an integer.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it out in Postman
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://god.gw.postman.com/run-collection/1559645-09569095-9ffb-4aba-bbca-92b2954aabde?action=collection%2Ffork&amp;amp;collection-url=entityId%3D1559645-09569095-9ffb-4aba-bbca-92b2954aabde%26entityType%3Dcollection%26workspaceId%3Daa5fb3b8-0090-4b5e-b3b4-fa5c1f2d080d" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs1b9allm9z4mcubik6rb.png" alt="Run in Postman button" width="434" height="98"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Fork the collection to your own workspace by clicking the Run in Postman button&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fork the collection&lt;/strong&gt; : Fork &lt;a href="https://www.postman.com/postman/workspace/postman-answers/collection/1559645-09569095-9ffb-4aba-bbca-92b2954aabde?ctx=documentation" rel="noopener noreferrer"&gt;the example collection&lt;/a&gt; from above to your own workspace by clicking the “Run in Postman” button.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create an API definition&lt;/strong&gt; : Create &lt;a href="https://learning.postman.com/docs/designing-and-developing-your-api/creating-an-api/" rel="noopener noreferrer"&gt;a new boilerplate API definition&lt;/a&gt; in your own workspace, and make sure to include the code from Rows 38 to 49 as seen in &lt;a href="https://www.postman.com/postman/workspace/postman-answers/api/5a01c61f-e5e1-4876-bde6-0c7c924e8282/version/3a97617a-c592-4f12-a766-fde92905d39b?tab=define" rel="noopener noreferrer"&gt;this example&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Define variables&lt;/strong&gt; : Add the ID for the API from the previous step and your &lt;a href="https://go.postman.co/settings/me/api-keys" rel="noopener noreferrer"&gt;Postman API key&lt;/a&gt; as collection variables. Store the &lt;a href="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.13.1/js-yaml.js" rel="noopener noreferrer"&gt;source code&lt;/a&gt; for &lt;a href="https://www.npmjs.com/package/js-yaml" rel="noopener noreferrer"&gt;this YAML parser&lt;/a&gt; in a &lt;a href="https://learning.postman.com/docs/sending-requests/managing-environments/" rel="noopener noreferrer"&gt;global variable&lt;/a&gt; called &lt;code&gt;yaml-js&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confirm scripts work as expected&lt;/strong&gt; : Send the call &lt;code&gt;Using a script&lt;/code&gt; to see the components in action.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customize your own components:&lt;/strong&gt; Update the API to customize your functions, or add new ones.
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Assessing the workaround for your use case
&lt;/h2&gt;

&lt;p&gt;What part of this solution works well?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can organize a custom group of scripts using an &lt;code&gt;x-&lt;/code&gt; prefix in the OpenAPI definition, such as for functions, tests, and other scripts.&lt;/li&gt;
&lt;li&gt;The OpenAPI definition is in Postman already, so you can add, edit, and run the new code in Postman without switching context.&lt;/li&gt;
&lt;li&gt;You can share these reusable components with team members in a team workspace.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What part of this solution does not work well?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This is not the intended purpose for reusable components in an OpenAPI definition.&lt;/li&gt;
&lt;li&gt;The reusable components are not written in a text editor, so syntax highlighting and formatting of JavaScript is missing. It’s easier to copy and paste code into the API definition.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;eval()&lt;/code&gt; poses &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval!" rel="noopener noreferrer"&gt;a major security risk&lt;/a&gt; and the user can run malicious code or code with unintended consequences.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Does this satisfy your particular use case? If not, this was not the only way to solve this problem. For example, the YAML parser was saved as a global variable available within a workspace, but we could have also made a call to a CDN to retrieve the source code for the library. We also used the Postman API to retrieve an API definition containing our reusable components, but we could have accessed our local file system for saved scripts instead.&lt;/p&gt;

&lt;p&gt;Feel free to explore some of the other alternatives listed above. And let us know some of your favorite hacks that you use in Postman in the comments below.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Technical review by Ian Douglas&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;The post &lt;a href="https://dev.to/mjgutermuth/create-reusable-tests-and-scripts-with-openapi-reusable-components-c2-temp-slug-700244"&gt;Create Reusable Tests and Scripts with OpenAPI Reusable Components&lt;/a&gt; appeared first on &lt;a href="https://blog.postman.com" rel="noopener noreferrer"&gt;Postman Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>editorspicks</category>
      <category>general</category>
      <category>tutorials</category>
      <category>openapi</category>
    </item>
    <item>
      <title>Set Up a WebSockets Server in Node.js</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Wed, 01 Feb 2023 15:54:45 +0000</pubDate>
      <link>https://dev.to/postman/set-up-a-websockets-server-in-nodejs-1b8e</link>
      <guid>https://dev.to/postman/set-up-a-websockets-server-in-nodejs-1b8e</guid>
      <description>&lt;p&gt;The &lt;a href="https://www.rfc-editor.org/rfc/rfc6455" rel="noopener noreferrer"&gt;WebSocket protocol&lt;/a&gt; provides a way to exchange data between a client and server over a persistent connection. The data can be passed in both directions with low latency and overhead, and without breaking the connection. This means the server can independently send data to the client without the client having to request it, and vice versa.&lt;/p&gt;

&lt;p&gt;WebSockets are great for building real-time functionality into web applications, such as games and chat apps, or for communicating financial trading data or IoT sensor data. More and more people are exploring &lt;a href="https://learning.postman.com/docs/sending-requests/websocket/websocket/" rel="noopener noreferrer"&gt;WebSocket APIs in Postman&lt;/a&gt;. According to Postman’s &lt;a href="https://www.postman.com/state-of-api/api-technologies/#api-technologies" rel="noopener noreferrer"&gt;2022 State of the API report&lt;/a&gt;, WebSockets are used by 26% of respondents.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage3-2-1000x634.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage3-2-1000x634.png" alt="According to the Postman State of the API report, WebSockets are used by 26% of respondents." width="800" height="507"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;According to the Postman State of the API report, WebSockets are used by 26% of respondents.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, let’s create a WebSocket server, and use Postman to send and receive messages across the WebSocket connection.&lt;/p&gt;
&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;p&gt;To follow along with this tutorial, you’ll need the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/download/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; installed on your machine&lt;/li&gt;
&lt;li&gt;A text editor like &lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;VSCode&lt;/a&gt; installed on your machine&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Create the Node.js server
&lt;/h2&gt;

&lt;p&gt;In your terminal, make a new directory called &lt;code&gt;websockets&lt;/code&gt; with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir websockets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, navigate into the new directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd websockets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, install &lt;a href="https://www.npmjs.com/package/ws" rel="noopener noreferrer"&gt;&lt;code&gt;ws&lt;/code&gt;&lt;/a&gt;, a WebSockets library for Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install ws
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Installing the WebSockets library like this also initializes your Node.js project and creates a package where your project files are stored. Open the &lt;code&gt;websockets&lt;/code&gt; directory using your preferred text editor, like VSCode. You should see the project files scaffolded as below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage2-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage2-4.png" alt="One sub-directory and two files at the first level of the root directory." width="800" height="145"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;One sub-directory and two files at the first level of the root directory.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Look inside the &lt;code&gt;package.json&lt;/code&gt; file to see the &lt;code&gt;ws&lt;/code&gt; dependency. Add the &lt;code&gt;"type": "module"&lt;/code&gt; to the &lt;code&gt;package.json&lt;/code&gt; so we can load an ES module in the next step. Your &lt;code&gt;package.json&lt;/code&gt; should look like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "module",
  "dependencies": {
    "ws": "^8.12.0"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the root directory, create a file called &lt;code&gt;index.js&lt;/code&gt; and paste the following code from the &lt;a href="https://www.npmjs.com/package/ws" rel="noopener noreferrer"&gt;&lt;code&gt;ws&lt;/code&gt;&lt;/a&gt; documentation for a “Simple server.” This code initializes the WebSockets server. Upon establishing a connection between the client and this server (once running), the server will send the message “something” to the client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { WebSocketServer } from 'ws';

const wss = new WebSocketServer({ port: 8080 });

wss.on('connection', function connection(ws) {
  ws.on('message', function message(data) {
    console.log('received: %s', data);
  });

  ws.send('something');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It’s now time to run our server locally from the command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Send and receive WebSocket messages
&lt;/h2&gt;

&lt;p&gt;In Postman, select &lt;strong&gt;New &amp;gt; WebSocket Request&lt;/strong&gt; to open a new tab. Enter the WebSocket server URL. A WebSocket URL begins with &lt;code&gt;ws://&lt;/code&gt; or &lt;code&gt;wss://&lt;/code&gt; and our server is running on &lt;code&gt;localhost:8080&lt;/code&gt;. Click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage4-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage4-3.png" alt="Connect to local server and receive a WebSocket message." width="800" height="441"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Connect to local server and receive a WebSocket message.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once Postman establishes the connection to your local server, the &lt;strong&gt;Messages&lt;/strong&gt; pane will display a list of messages for the WebSocket connection, including incoming, outgoing, and network messages. You can further inspect the connection details by clicking on “Connected to ws://localhost:8080”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage1-4-1000x648.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage1-4-1000x648.png" alt="Inspect handshake details." width="800" height="518"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Inspect handshake details.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The connection we established between the Postman client and local server is bidirectional, which means that in addition to receiving messages, we can also send them. Under the &lt;strong&gt;Message&lt;/strong&gt; tab, write your own message and click &lt;strong&gt;Send&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you have good reflexes, you may have seen your outgoing message in the &lt;strong&gt;Messages&lt;/strong&gt; pane. If not, filter for the message using the controls or search bar in the &lt;strong&gt;Messages&lt;/strong&gt; pane.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage8-2-1000x648.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage8-2-1000x648.png" alt="Filter or search for specific messages in the Messages pane." width="800" height="518"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Filter or search for specific messages in the Messages pane.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Verify the outgoing message was received by your local server:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage5-3-1000x118.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage5-3-1000x118.png" alt="Received messages are logged to the console of the local server." width="800" height="94"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Send system information
&lt;/h2&gt;

&lt;p&gt;Let’s update our WebSockets server to send something a little more interesting, like our computer’s information, using the &lt;a href="https://www.npmjs.com/package/systeminformation" rel="noopener noreferrer"&gt;&lt;code&gt;systeminformation&lt;/code&gt;&lt;/a&gt; node package. Terminate the running server ( &lt;strong&gt;Ctrl + C&lt;/strong&gt; ) and install the package from the command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install systeminformation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, import the package by adding the following code to the top of &lt;code&gt;index.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import si from "systeminformation";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code immediately after our WebSocket connection sends the string “something”. Every 1,000 milliseconds, we will send a message about the current load on our CPU.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; setInterval(async () =&amp;gt; {
    const cpuTemp = JSON.stringify(await si.currentLoad());
    ws.send(cpuTemp);
  }, 1000);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save your changes, and restart the local server from the command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Return to Postman and &lt;strong&gt;Connect&lt;/strong&gt; to the local server. This time, we receive information about our CPU every second!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage7-3-1000x648.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage7-3-1000x648.png" alt="Local server sends CPU data every one second." width="800" height="518"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Local server sends CPU data every one second.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Click on a message to expand the message details and further inspect the data sent from our local server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage6-2-1000x648.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.postman.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fimage6-2-1000x648.png" alt="Expand message details." width="800" height="518"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Expand message details.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The messages will keep coming until you terminate the connection. Use Postman to &lt;strong&gt;Disconnect&lt;/strong&gt; from the server.&lt;/p&gt;

&lt;p&gt;Now that we have a functioning WebSocket server, we can do more things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slow down the messages coming from the local server. Try updating &lt;code&gt;1000&lt;/code&gt; milliseconds to &lt;code&gt;3000&lt;/code&gt; milliseconds to see what happens.&lt;/li&gt;
&lt;li&gt;Instead of sending all the data, try sending only the average load. You may want to inspect the messages in Postman to parse the data properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can write more code to customize our local application. Upon receiving a message from the client, we can do more than logging the message to the console. We can also retrieve data from other sources and perform calculations before sending our messages to the client.&lt;/p&gt;
&lt;h2&gt;
  
  
  Additional resources
&lt;/h2&gt;

&lt;p&gt;To follow along with this tutorial, watch the &lt;a href="https://www.youtube.com/watch?v=e__oWJ4wNtw" rel="noopener noreferrer"&gt;video&lt;/a&gt; and reference the documentation at &lt;a href="https://quickstarts.postman.com/guide/websockets_node/index.html" rel="noopener noreferrer"&gt;Postman Quickstarts&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/e__oWJ4wNtw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Check out these Postman resources to learn more about WebSockets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/postman/workspace/websockets/documentation/14057978-712d684f-c252-4bd9-a7a6-6a893e41adea" rel="noopener noreferrer"&gt;Guide to Postman WebSockets&lt;/a&gt; collection&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://learning.postman.com/docs/sending-requests/websocket/websocket/" rel="noopener noreferrer"&gt;Using WebSocket requests&lt;/a&gt; docs&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://youtu.be/H-7EZVj9D-k" rel="noopener noreferrer"&gt;WebSocket requests&lt;/a&gt; video&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next post, we will explore how to use our WebSockets server with Internet of Things (IoT) devices and do neat stuff around the home. Let us know in the comments below what kind of projects you want to learn more about, and what you’re doing with WebSockets.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Technical review by Ian Douglas.&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;The post &lt;a href="https://blog.postman.com/set-up-a-websockets-server-in-node-js-postman/" rel="noopener noreferrer"&gt;Set Up a WebSockets Server in Node.js&lt;/a&gt; appeared first on &lt;a href="https://blog.postman.com" rel="noopener noreferrer"&gt;Postman Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>editorspicks</category>
      <category>general</category>
      <category>tutorials</category>
      <category>websockets</category>
    </item>
    <item>
      <title>From On-Premises to Cloud APIs: A Meta Example</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Wed, 01 Jun 2022 16:12:20 +0000</pubDate>
      <link>https://dev.to/postman/from-on-premises-to-cloud-apis-a-meta-example-fni</link>
      <guid>https://dev.to/postman/from-on-premises-to-cloud-apis-a-meta-example-fni</guid>
      <description>&lt;p&gt;&lt;a href="https://www.postman.com/meta" rel="noopener noreferrer"&gt;Meta&lt;/a&gt; is the latest major tech player to recently announce &lt;a href="https://techcrunch.com/2022/05/19/whatsapp-ramps-up-revenue-with-global-launch-of-cloud-api-and-soon-a-paid-tier-for-its-business-app/" rel="noopener noreferrer"&gt;broader developer access to their WhatsApp Cloud API&lt;/a&gt;. Meta owns several social media and messaging platforms including WhatsApp, Messenger, and Instagram. In addition to providing an app and an on-premises API, WhatsApp is opening access to their cloud API, previously limited to a group of partners in beta testing, in order to increase their market reach to include smaller companies.&lt;/p&gt;

&lt;p&gt;API producers continue investing in cloud APIs. However, &lt;a href="https://www.f5.com/pdf/reports/f5-office-of-the-cto-report-continuous-api-sprawl.pdf#page=12" rel="noopener noreferrer"&gt;on-premises APIs are still widely prevalent&lt;/a&gt;, especially in some highly-regulated industries. For some behemoth &lt;a href="https://dev.to/jansche/how-the-postman-enterprise-plan-fits-into-your-2022-enterprise-strategy-4h2h-temp-slug-3621066"&gt;enterprises&lt;/a&gt; still only dreaming about cloud solutions and companies embracing cloud-native trends, more investment in cloud APIs is welcome news.&lt;/p&gt;

&lt;p&gt;Why is Meta, like so many other API providers, doing this?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an on-premises web API?
&lt;/h2&gt;

&lt;p&gt;An on-premises web API is one that is deployed on infrastructure owned and managed by the consumer. For example, if you used the WhatsApp Business Platform on-premises API, you could choose to host it on a private server in your on-site data center behind your own firewalls.&lt;/p&gt;

&lt;p&gt;Certain industries like artificial intelligence (AI) and electronic data interchange (EDI) frequently provide their solutions as on-premises APIs, even though most now offer cloud or hybrid solutions. And for API consumers, many large enterprises, especially those facing regulatory or compliance requirements, still choose to adopt on-premises APIs.&lt;/p&gt;

&lt;p&gt;The following are notable features of on-premises APIs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provision and manage your own infrastructure&lt;/li&gt;
&lt;li&gt;Control your own data for security regulations or compliance requirements&lt;/li&gt;
&lt;li&gt;Administer your own software updates&lt;/li&gt;
&lt;li&gt;Monitor and manage your own uptime&lt;/li&gt;
&lt;li&gt;Manage your own certificates&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is a cloud web API?
&lt;/h2&gt;

&lt;p&gt;A cloud API is one hosted by the API provider and deployed on infrastructure owned and managed by the API provider, instead of the consumer. For example, Meta’s cloud API is deployed on Meta’s infrastructure. The WhatsApp docs outline &lt;a href="https://developers.facebook.com/docs/whatsapp/cloud-api/overview#on-premises-api-vs--cloud-api-comparison" rel="noopener noreferrer"&gt;the differences between their on-premises and cloud APIs&lt;/a&gt; in more detail.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mzGlS-8n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/05/image1-1-1000x649.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mzGlS-8n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/05/image1-1-1000x649.png" alt="Check out the WhatsApp Business Platform public workspace" width="800" height="519"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Check out the &lt;a href="https://www.postman.com/meta/workspace/a31742be-ce5c-4b9d-a828-e10ee7f7a5a3/overview" rel="noopener noreferrer"&gt;WhatsApp Business Platform public workspace&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Adopting cloud APIs significantly reduces the barriers to entry, and speeds time to implementation for consumers. Developers can develop an integration in minutes, instead of weeks.&lt;/p&gt;

&lt;p&gt;The following are notable features of cloud APIs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster time to implementation&lt;/li&gt;
&lt;li&gt;Scale up and down usage without incurring incremental infrastructure costs&lt;/li&gt;
&lt;li&gt;Your anonymized and aggregated data may be used to improve the product (such as with refining machine learning models)&lt;/li&gt;
&lt;li&gt;Usually no control over when updates are administered&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Is cloud the future?
&lt;/h2&gt;

&lt;p&gt;For every startup that adopts the latest technologies splashing the headlines, there are ten more well-established businesses that are maintaining legacy code and juggling industry regulations. For API providers, the decision is simple. It’s not a competition between cloud APIs and on-premises APIs. Providers, like Meta, will continue supporting both as long as consumers demand both.&lt;/p&gt;

&lt;a href="https://blog.postman.com/wp-content/uploads/2022/05/2022-05-27-110738180.mp4" rel="noopener noreferrer"&gt;https://blog.postman.com/wp-content/uploads/2022/05/2022-05-27-110738180.mp4&lt;/a&gt;

&lt;p&gt;Let us know in the comments below if you observe these same trends within your industry.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.postman.com/on-premises-to-cloud-apis-meta/" rel="noopener noreferrer"&gt;From On-Premises to Cloud APIs: A Meta Example&lt;/a&gt; appeared first on &lt;a href="https://blog.postman.com" rel="noopener noreferrer"&gt;Postman Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>discuss</category>
      <category>programming</category>
      <category>postman</category>
    </item>
    <item>
      <title>How to Be Our Guest on the Postman Blog</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Mon, 09 May 2022 16:53:08 +0000</pubDate>
      <link>https://dev.to/postman/how-to-be-our-guest-on-the-postman-blog-3dah</link>
      <guid>https://dev.to/postman/how-to-be-our-guest-on-the-postman-blog-3dah</guid>
      <description>&lt;p&gt;When I want to learn how to do something in Postman, the internet is flooded with tutorials and videos from community members who want to share their knowledge with the rest of us. Postman has one of the most talented and generous communities in the world.&lt;/p&gt;

&lt;p&gt;And you might already know that Postman has an open call for guest writers to contribute original articles. If you’re interested in writing for the &lt;a href="https://blog.postman.com/" rel="noopener noreferrer"&gt;Postman blog&lt;/a&gt;, check out the detailed &lt;a href="https://www.postman.com/postman-contributor-guest-blogger/" rel="noopener noreferrer"&gt;submission guidelines for our guest blogger program here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Read on for ideas and inspiration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should you write about?
&lt;/h2&gt;

&lt;p&gt;Postman is looking for technical tutorials, thought leadership, and other educational resources to teach our community something new and discover what’s possible with APIs. This is an opportunity for developers of all experience levels to contribute to the Postman blog.&lt;/p&gt;

&lt;p&gt;Here are examples of exemplary guest contributions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.postman.com/how-to-catch-breaking-changes-before-they-happen/" rel="noopener noreferrer"&gt;&lt;strong&gt;How to Catch Breaking Changes Before They Happen&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;by Allen Helton&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This writer shares a personal anecdote about the SmartThings API releasing an update that breaks his home automation workflow. He recommends some ways to increase resilience, and shows how to set up your own monitor for breaking changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.postman.com/shift-left-testing/" rel="noopener noreferrer"&gt;&lt;strong&gt;Shift-Left Testing: What It Is and How to Achieve It&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;by Dan Martin&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This writer introduces an industry trend called shift-left testing and tells a real-world example of a client shifting left. He talks about the struggles, requirements, and benefits of making this change for test automation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.postman.com/automate-your-reading-list-typeform-notion-integration/" rel="noopener noreferrer"&gt;&lt;strong&gt;Automate Your Reading List with a Typeform and Notion Integration&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;by Nicolas Grenié&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This writer walks step-by-step through how to set up an integration using his organization’s API and another public API and then suggests ways to go beyond the initial scenario. He also talks about dealing with recursion using a Postman script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.postman.com/how-spritely-uses-postman-to-create-health-tech-for-retirees/" rel="noopener noreferrer"&gt;&lt;strong&gt;How Spritely Uses Postman to Create Health Tech for Retirees&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;by Ryan Cornelius&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This writer talks about an industry trend called Fast Healthcare Interoperability Resources (FHIR), the state of healthcare in New Zealand, and how his organization uses Postman to create the APIs empowering interconnected medical devices.&lt;/p&gt;

&lt;p&gt;The topics that resonate best with the Postman community:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Show you how to build something&lt;/li&gt;
&lt;li&gt;Introduce a technology or concept (or a fresh take on it)&lt;/li&gt;
&lt;li&gt;Describe something interesting happening in an industry and why it’s important&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Check out the guest blog&lt;/strong&gt; &lt;a href="https://www.postman.com/postman-contributor-guest-blogger/" rel="noopener noreferrer"&gt;&lt;strong&gt;submission guidelines&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;for more information, and to submit an idea.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What should you NOT write about?
&lt;/h2&gt;

&lt;p&gt;No sales pitches or overtly self-promotional content. If you’re excited about your company’s latest release or introducing a new public workspace, that is a stellar topic for your own blog or a social media post.&lt;/p&gt;

&lt;p&gt;These topics are not acceptable for the Postman blog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first page of your developer docs&lt;/li&gt;
&lt;li&gt;Why your technology is great&lt;/li&gt;
&lt;li&gt;Non-original content, or a rehash of something you’ve already written on your own blog&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While these are great topics for other channels, they’re not relevant for the Postman blog as stand-alone articles. If you think the Postman community wants to know about your ideas, tweet about it and tag Postman so we can help support it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What if I don’t want to write for the Postman blog?
&lt;/h2&gt;

&lt;p&gt;If you’re content to blog on your own or really like making videos and workshops, we’d love to hear about it! Let us know what you’re working on by tagging Postman on social media on &lt;a href="https://twitter.com/getpostman" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; or &lt;a href="https://www.linkedin.com/company/postman" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, or tell us in the comments below. And if you’re interested in a full-time job that involves writing or doing something else, Postman is &lt;a href="https://www.postman.com/company/careers/open-positions/" rel="noopener noreferrer"&gt;always hiring&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.postman.com/how-to-guest-postman-blog/" rel="noopener noreferrer"&gt;How to Be Our Guest on the Postman Blog&lt;/a&gt; appeared first on &lt;a href="https://blog.postman.com" rel="noopener noreferrer"&gt;Postman Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>career</category>
      <category>tutorial</category>
      <category>testing</category>
    </item>
    <item>
      <title>Video Tutorial: Twilio’s Livestream API in Postman</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Wed, 30 Mar 2022 16:54:48 +0000</pubDate>
      <link>https://dev.to/postman/video-tutorial-twilios-livestream-api-in-postman-5pd</link>
      <guid>https://dev.to/postman/video-tutorial-twilios-livestream-api-in-postman-5pd</guid>
      <description>&lt;p&gt;During a recent &lt;a href="https://www.youtube.com/watch?v=PiOL9Dtf7NI" rel="noopener noreferrer"&gt;Postman livestream&lt;/a&gt; with Twilio Principal Software Engineer &lt;a href="https://twitter.com/miguelgrinberg" rel="noopener noreferrer"&gt;Miguel Grinberg&lt;/a&gt;, we streamed about streaming using the just-released Twilio Live API to build our own interactive audio and video livestreaming experience. Most developers are familiar with &lt;a href="https://www.postman.com/81225/workspace/twilio-api/collection/12503610-194919ce-e80b-44da-8eec-45ea8e74cdfb" rel="noopener noreferrer"&gt;Twilio’s SMS messaging API&lt;/a&gt;, but Twilio has a plethora of other communication APIs in their &lt;a href="https://www.postman.com/81225/workspace/twilio-api/overview" rel="noopener noreferrer"&gt;public workspace in Postman&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Miguel is well known in the Python community for authoring several books on Python and Flask. Fortunately for me, we decided to work with Node.js and in Postman. Miguel used his new favorite API to invite live viewers to join a separate livestream (without audio to avoid an echo), which inevitably led to &lt;a href="https://twitter.com/PetuniaGray/status/1491895405440761856?s=20&amp;amp;t=HHUR2DcLDxyBM2kwALOOpA" rel="noopener noreferrer"&gt;a stream for mimes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Watch what happened and hear straight from Miguel in this full video:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/PiOL9Dtf7NI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Check out a few highlights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=PiOL9Dtf7NI&amp;amp;t=977s" rel="noopener noreferrer"&gt;Fork and deploy the example video application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=PiOL9Dtf7NI&amp;amp;t=2210s" rel="noopener noreferrer"&gt;Import OpenAPI specification in Postman&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=PiOL9Dtf7NI&amp;amp;t=2564s" rel="noopener noreferrer"&gt;Create player streamer and media processor via API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=PiOL9Dtf7NI&amp;amp;t=4553s" rel="noopener noreferrer"&gt;Invite live viewers to join&lt;/a&gt; the Twilio livestream on Postman livestream&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Follow along at home with these resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Fork the &lt;a href="https://github.com/miguelgrinberg/twilio-serverless-video-call" rel="noopener noreferrer"&gt;example video application code&lt;/a&gt; from GitHub&lt;/li&gt;
&lt;li&gt;Reference the &lt;a href="https://www.postman.com/81225/workspace/twilio-api/api/1158f8bc-fca7-4ab8-beea-c8b490200d5b/version/d20ddfa0-fa45-4668-bd50-0ff546ce3c2d?tab=define" rel="noopener noreferrer"&gt;Twilio Live API&lt;/a&gt;from Postman (called “Twilio – Media”), or fork the &lt;a href="https://www.postman.com/postman/workspace/postman-live/collection/1559645-00ee447d-70a5-4430-b107-c62e02a316d5" rel="noopener noreferrer"&gt;Twilio Live collection&lt;/a&gt; generated from the specification&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Don’t miss upcoming streams
&lt;/h2&gt;

&lt;p&gt;Postman currently streams every week on Thursdays. Stop by and say hi, y’all. Follow or subscribe on any of these platforms so you never miss hearing about streams like this one:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;YouTube: Subscribe to the &lt;a href="https://www.youtube.com/channel/UCocudCGVb3MmhWQ1aoIgUQw" rel="noopener noreferrer"&gt;Postman on YouTube&lt;/a&gt; and turn on your notifications&lt;/li&gt;
&lt;li&gt;Twitch: Follow &lt;a href="https://www.twitch.tv/getpostman" rel="noopener noreferrer"&gt;Postman on Twitch&lt;/a&gt; to receive notifications when we go live&lt;/li&gt;
&lt;li&gt;Twitter: Follow &lt;a href="https://twitter.com/getpostman" rel="noopener noreferrer"&gt;Postman on Twitter&lt;/a&gt; to see when we go live&lt;/li&gt;
&lt;li&gt;LinkedIn: Follow &lt;a href="https://www.linkedin.com/company/postman-platform/" rel="noopener noreferrer"&gt;Postman on LinkedIn&lt;/a&gt; to be notified of upcoming events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://blog.postman.com/livestreaming-with-twilios-livestream-api/" rel="noopener noreferrer"&gt;Livestreaming with Twilio’s Livestream API&lt;/a&gt; appeared first on &lt;a href="https://blog.postman.com" rel="noopener noreferrer"&gt;Postman Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>APIs to Automate Your DevOps Workflows</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Wed, 16 Mar 2022 15:00:25 +0000</pubDate>
      <link>https://dev.to/postman/apis-to-automate-your-devops-workflows-1nki</link>
      <guid>https://dev.to/postman/apis-to-automate-your-devops-workflows-1nki</guid>
      <description>&lt;p&gt;With the &lt;a href="https://www.postman.com/explore" rel="noopener noreferrer"&gt;Public API Network&lt;/a&gt; offering APIs for nearly everything, this handpicked list is a group of popular APIs to automate your operations workflows. You can now make them part of your developer toolkit, and try them out by forking their collections to your own workspace to start exploring the possibilities. Learn about their tech, explore their APIs for free, and don’t forget about other Postman-featured APIs, workspaces, and collections in the network.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/dockerdev" rel="noopener noreferrer"&gt;Docker&lt;/a&gt; has become synonymous with containers, which are used to simplify and automate the deployment process for applications. And Docker Hub is the world’s largest library of container images from software vendors, open source projects, and the community. See how you can create, manage, and deliver your container applications in this &lt;a href="https://www.postman.com/dockerdev/workspace/docker-hub/overview" rel="noopener noreferrer"&gt;Docker Hub public workspace&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/circleci-dev" rel="noopener noreferrer"&gt;CircleCI&lt;/a&gt; is a continuous integration and delivery (CI/CD) platform. Fine tune your development processes with pipelines, jobs, and workflows using the CircleCI API to deliver quality code with confidence. Try it out in this &lt;a href="https://www.postman.com/circleci-dev/workspace/circleci-api-hub/overview" rel="noopener noreferrer"&gt;CircleCI public workspace&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/humanitec" rel="noopener noreferrer"&gt;Humanitec&lt;/a&gt; empowers developers to build an internal developer platform. Improve your productivity by automating deployments, orchestrate infrastructure, and spin up environments. Or deploy a simple web application to a Kubernetes Cluster using the Humanitec API. Try it out in this &lt;a href="https://www.postman.com/humanitec/workspace/humanitec-s-public-workspace/overview" rel="noopener noreferrer"&gt;Humanitec public workspace&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/cloudbees" rel="noopener noreferrer"&gt;CloudBees&lt;/a&gt; is a DevOps technology platform to automate previously manual jobs with continuous integration and delivery. Their feature management API allows development teams to release, control, and measure features in any environment in the deployment pipeline. Try it out in this &lt;a href="https://www.postman.com/cloudbees/workspace/cloudbees-feature-management/overview" rel="noopener noreferrer"&gt;CloudBees public workspace&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/vultr-api" rel="noopener noreferrer"&gt;Vultr&lt;/a&gt; is an infrastructure cloud provider to deploy cloud servers, bare metal, and storage. They are an API-first company, and their API is teeming with resources to build apps and automate infrastructure management without using a customer portal. Save time managing your infrastructure and check out their recently-launched Vultr Kubernetes Engine. Check out their API in this &lt;a href="https://www.postman.com/vultr-api/workspace/vultr-api-v2/overview" rel="noopener noreferrer"&gt;Vultr public workspace&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/oracledevs" rel="noopener noreferrer"&gt;Oracle Cloud&lt;/a&gt; is a cloud computing service for enterprise applications. Their public workspaces are packed with extensive API references and helpful guides for scaling up your infrastructure. Splash around in their &lt;a href="https://www.postman.com/oracledevs/workspace/oke-kubernetes-playground/overview" rel="noopener noreferrer"&gt;Kubernetes Playground&lt;/a&gt;for Oracle Container Engine for Kubernetes (OKE). Or if you’re just getting started, check out the &lt;a href="https://www.postman.com/oracledevs/workspace/oracle-cloud-infrastructure-rest-apis/overview" rel="noopener noreferrer"&gt;Oracle Cloud Infrastructure REST APIs public workspace&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We hope these free up your operations team by automating your tedious DevOps workflows. And if you have other automation APIs to recommend, let us know in the comments below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.postman.com/downloads/" rel="noopener noreferrer"&gt;&lt;strong&gt;Try Postman now&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.postman.com/apis-to-automate-devops-workflows/" rel="noopener noreferrer"&gt;APIs to Automate Your DevOps Workflows&lt;/a&gt; appeared first on &lt;a href="https://blog.postman.com" rel="noopener noreferrer"&gt;Postman Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>devops</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Build a Postman Alert for HackerNews</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Mon, 14 Mar 2022 15:00:00 +0000</pubDate>
      <link>https://dev.to/postman/build-a-postman-alert-for-hackernews-1big</link>
      <guid>https://dev.to/postman/build-a-postman-alert-for-hackernews-1big</guid>
      <description>&lt;p&gt;It’s every founder’s worst nightmare: your startup is going viral on &lt;a href="https://news.ycombinator.com/news" rel="noopener noreferrer"&gt;HackerNews&lt;/a&gt; (HN), and you hear about it first from a customer, or worse yet, an investor. HackerNews is a message board known for its opinionated pundits stirring up discussions on everything related to technology. While it’s important to keep a pulse on the community, you may not have the resources or bandwidth to scour the interwebs for any mention of your company.&lt;/p&gt;

&lt;p&gt;Let’s set up and customize your own Postman alert by cobbling together a few API calls and scheduling a cron job to run on Postman servers. In this example, we can watch HackerNews for any mention of our company, and then get notified on Discord.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GsF8k0t_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNews-1-1000x340.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GsF8k0t_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNews-1-1000x340.png" alt="A monitor is like a cron job running on Postman servers" width="800" height="272"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;A monitor is like a cron job running on Postman servers&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up the alert
&lt;/h2&gt;

&lt;p&gt;Fork the collection from this &lt;a href="https://www.postman.com/devrel/workspace/49ed8ced-a637-4a35-9c7c-8eb441d21c11/overview" rel="noopener noreferrer"&gt;HackerNews public workspace&lt;/a&gt; by clicking the orange Run in Postman button below. If you also choose to “watch” the collection, you can get notified about updates when new API workflows are added to the collection.&lt;/p&gt;

&lt;p&gt;Next, configure two parameters and schedule a monitor in your own workspace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Set config&lt;/strong&gt; : Under the &lt;strong&gt;Body&lt;/strong&gt; tab of the &lt;a href="https://www.postman.com/devrel/workspace/49ed8ced-a637-4a35-9c7c-8eb441d21c11/request/13191452-be7f6cde-fd5a-49de-9a5f-641f72372c2d" rel="noopener noreferrer"&gt;“Set config” request&lt;/a&gt;, update the &lt;code&gt;keyword&lt;/code&gt; to the name of your own startup. Then update the &lt;code&gt;destination&lt;/code&gt; to your own discord webhook (or other type of webhook).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dc4IQL9K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNews-2-1000x547.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dc4IQL9K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNews-2-1000x547.png" alt="set the  raw `keyword` endraw  and  raw `destination` endraw  parameters to configure the monitor" width="800" height="438"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Set the keyword and destination parameters to configure the monitor&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Schedule a monitor&lt;/strong&gt; : Once you have the alert working locally like you want it, &lt;a href="https://learning.postman.com/docs/monitoring-your-api/setting-up-monitor/" rel="noopener noreferrer"&gt;schedule a monitor&lt;/a&gt; to run this collection from Postman servers as frequently as every five minutes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8x8GovlM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNews-3-1000x598.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8x8GovlM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNews-3-1000x598.png" alt="Schedule a monitor to run as frequently as every five minutes" width="800" height="478"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Schedule a monitor to run as frequently as every five minutes&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And that’s it!&lt;/p&gt;

&lt;p&gt;In the next section, let’s see what’s happening behind the scenes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The API workflow
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GHs135Es--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNews-4-1000x306.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GHs135Es--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNews-4-1000x306.png" alt="The API workflow to send an alert based on content in HackerNews stories" width="800" height="245"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The API workflow to send an alert based on content in HackerNews stories&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you forked &lt;a href="https://www.postman.com/devrel/workspace/49ed8ced-a637-4a35-9c7c-8eb441d21c11/collection/13191452-c7564f39-0cac-4939-877e-da91239829bb?ctx=documentation" rel="noopener noreferrer"&gt;the collection&lt;/a&gt;, you can review the code under the &lt;strong&gt;Pre-request Script&lt;/strong&gt; and &lt;strong&gt;Tests&lt;/strong&gt; tabs for each API call. The API workflow utilizes the first four requests in the collection.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;POST&lt;/code&gt; Set config&lt;/strong&gt; : The first request “Set config” is a dummy request to &lt;a href="https://www.postman.com/postman/workspace/20c9374c-0841-4b30-90b7-731b29821d43/overview" rel="noopener noreferrer"&gt;httpbin&lt;/a&gt;. It requires setting two parameters that are saved as collection variables to be used in subsequent requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;GET&lt;/code&gt; Get HN Top stories&lt;/strong&gt; : This request queries the HN API to retrieve the top stories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;GET&lt;/code&gt; Get HN item by id&lt;/strong&gt; : The third request queries the HN API to check each story retrieved in the previous step, looking for the keyword specified. Postman will continue to cycle on the current query until there are no more stories to check. If the keyword is detected, Postman moves on to the last request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;POST&lt;/code&gt; Send alert&lt;/strong&gt; : This request is only triggered when the keyword is detected in the previous step, and issues an alert to Discord about the HN story containing the keyword. This request can also be updated to trigger alerts on other platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yf9m8L6i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNers5-1000x598.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yf9m8L6i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://blog.postman.com/wp-content/uploads/2022/03/HackerNers5-1000x598.png" alt="Conditional logic under the Tests tab to send an alert only when keyword is detected" width="800" height="478"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Conditional logic under the Tests tab to send an alert only when keyword is detected&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you caught all of that, then you understand these fundamental concepts in Postman:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collection:&lt;/strong&gt; A &lt;a href="https://learning.postman.com/docs/sending-requests/intro-to-collections/" rel="noopener noreferrer"&gt;collection&lt;/a&gt; is a group of requests. This is helpful for organizing your work and collaborating with teammates. But it’s also the foundational building block for more advanced features in Postman, such as executing a more complex API workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scripting:&lt;/strong&gt; You can add JavaScript code to run before and after an API call as &lt;a href="https://learning.postman.com/docs/writing-scripts/intro-to-scripts/" rel="noopener noreferrer"&gt;pre-request and test scripts&lt;/a&gt;, respectively. This is the basis of test assertions once you receive a response from the server. But also allows you to control your API workflows, and incorporate branching and looping logic, like we did in this example.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor:&lt;/strong&gt; A &lt;a href="https://learning.postman.com/docs/running-collections/scheduling-collection-runs/" rel="noopener noreferrer"&gt;monitor&lt;/a&gt; is like a cron job running on Postman servers. Lots of people use them to monitor the health of their websites and APIs. But you can also use them to run any kind of API workflow on a scheduled cadence. Monitors are closely related to &lt;a href="https://learning.postman.com/docs/running-collections/collection-webhooks/" rel="noopener noreferrer"&gt;webhooks&lt;/a&gt;, which are actually monitors triggered by an event.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to this HackerNews alert, browse other samples and documentation for the &lt;a href="https://github.com/HackerNews/API" rel="noopener noreferrer"&gt;Official HN API&lt;/a&gt; in &lt;a href="https://www.postman.com/devrel/workspace/49ed8ced-a637-4a35-9c7c-8eb441d21c11/overview" rel="noopener noreferrer"&gt;this public workspace&lt;/a&gt;. You can swap out HackerNews with other social media sites. Or you can swap out Discord for a different platform to receive a notification. And once you learn how to build one alert, you can build an army of them to be your eyes and ears across the Internet.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://blog.postman.com/postman-alert-for-hackernews/" rel="noopener noreferrer"&gt;Build a Postman Alert for HackerNews&lt;/a&gt; appeared first on &lt;a href="https://blog.postman.com" rel="noopener noreferrer"&gt;Postman Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Build a Jamstack Application in Postman</title>
      <dc:creator>Joyce Lin</dc:creator>
      <pubDate>Mon, 31 Jan 2022 17:40:03 +0000</pubDate>
      <link>https://dev.to/postman/how-to-build-a-jamstack-application-in-postman-h19</link>
      <guid>https://dev.to/postman/how-to-build-a-jamstack-application-in-postman-h19</guid>
      <description>&lt;p&gt;Jamstack originally referenced a web architecture composed of JAM: JavaScript, APIs, and Markup. Websites could be delivered statically, such as serving HTML from static hosting, while providing dynamic content and an interactive experience through JavaScript and APIs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup&lt;br&gt;
—Mathias Biilmann, Co-Founder and CEO of Netlify&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This type of architecture decouples the frontend from the backend. So instead of running on a backend web server, a Jamstack site typically deploys to a content delivery network (CDN) so web content can be delivered quickly from edge servers that are close to the end users and API endpoints can be hosted on serverless architecture.&lt;/p&gt;

&lt;p&gt;Over the last few years, Jamstack has grown beyond just sites to serve static content, and it has led to a &lt;a href="https://remotesynthesis.com/blog/jamstack-in-2021" rel="noopener noreferrer"&gt;colorful debate&lt;/a&gt; about what constitutes Jamstack and even opinions about its capitalization. Regardless of your criteria, these static web apps are becoming very popular among hobbyists and global enterprises alike. And their growth is further driven by the booming API economy that can offer any variety of third-party services and turnkey solutions.&lt;/p&gt;

&lt;p&gt;For developers who are new to Jamstack, let’s walk through a simplified example in Postman to see how each part of the JAM works.&lt;/p&gt;

&lt;h2&gt;
  
  
  4 steps to build a Jamstack application in Postman
&lt;/h2&gt;

&lt;p&gt;The modular and decoupled nature of Jamstack architecture means there are a bunch of tools available to help you with each part of the implementation. For example, most Jamstack applications are developed using JavaScript web frameworks like &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt; and &lt;a href="https://www.gatsbyjs.com/" rel="noopener noreferrer"&gt;Gatsby&lt;/a&gt;. And then they’re deployed using services like &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt; and &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; and hosted on a content delivery network (CDN).&lt;/p&gt;

&lt;p&gt;Let’s build and host a simplified Jamstack application in Postman using code samples from &lt;a href="https://learning.postman.com/docs/sending-requests/visualizer/" rel="noopener noreferrer"&gt;the Postman documentation for the visualizer&lt;/a&gt;. And then we will take a closer look at the JAM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Create a collection:&lt;/strong&gt; In Postman, create a new collection named &lt;code&gt;Jamstack&lt;/code&gt;. Then add a &lt;code&gt;GET&lt;/code&gt; request to the collection named &lt;code&gt;API call&lt;/code&gt; with the request URL &lt;code&gt;{{url}}/data&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl3o3rgd3putx0iyjo9wk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl3o3rgd3putx0iyjo9wk.png" alt="create a collection" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Add an example response:&lt;/strong&gt; Select the overflow menu (…) of the request to add an example response (&lt;code&gt;e.g.&lt;/code&gt;) called &lt;code&gt;Example data&lt;/code&gt;. This example response is what will be returned from our mock server. Under the &lt;strong&gt;Body&lt;/strong&gt; tab of the example response (on the bottom), select the &lt;code&gt;JSON&lt;/code&gt; data type from the dropdown menu. Then add the following placeholder JSON. If you’re copying from the Postman documentation, make sure to remove the commented row beginning with &lt;code&gt;//&lt;/code&gt; and preceding &lt;code&gt;,&lt;/code&gt; character so that the JSON is valid.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
    {
        "name": "Alice",
        "email": "alice@example.com"
    },
    {
        "name": "Jack",
        "email": "jack@example.com"
    }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under the &lt;strong&gt;Headers&lt;/strong&gt; tab of the example response (still on the bottom), add a header with a key &lt;code&gt;Content-type&lt;/code&gt; and value &lt;code&gt;application/json&lt;/code&gt;. Lastly, add a response status code of &lt;code&gt;200 OK&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzethzc9traunzkl49i3y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzethzc9traunzkl49i3y.png" alt="add an example response" width="800" height="509"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Add a mock server:&lt;/strong&gt; Select the overflow menu (…) of the collection &lt;code&gt;Jamstack&lt;/code&gt; to &lt;a href="https://learning.postman.com/docs/designing-and-developing-your-api/mocking-data/setting-up-mock/#creating-a-mock-from-a-collection" rel="noopener noreferrer"&gt;add a new mock server&lt;/a&gt; called &lt;code&gt;Mock data&lt;/code&gt; to the collection. Once Postman finishes creating a mock server, select the new environment created by Postman called &lt;code&gt;Mock data&lt;/code&gt;. Hover on &lt;code&gt;{{url}}&lt;/code&gt; in the request URL to see the value being read from the actively-selected environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbn4i3e2juacnqt8cbhw3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbn4i3e2juacnqt8cbhw3.png" alt="Add a mock server to the collection" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Visualize the data:&lt;/strong&gt; Select the request &lt;code&gt;API call&lt;/code&gt;, and send the request to see the example data returning from the mock server. To update the data returned from the mock server, you can edit the example response body (&lt;code&gt;e.g.&lt;/code&gt;). We will continue using code samples from &lt;a href="https://learning.postman.com/docs/sending-requests/visualizer/" rel="noopener noreferrer"&gt;the Postman documentation for the visualizer&lt;/a&gt;. Under the &lt;strong&gt;Tests&lt;/strong&gt; tab, add the following code for an HTML table represented as a template string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var template = `
    &amp;lt;table bgcolor="#FFFFFF"&amp;gt;
        &amp;lt;tr&amp;gt;
            &amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;
            &amp;lt;th&amp;gt;Email&amp;lt;/th&amp;gt;
        &amp;lt;/tr&amp;gt;
        {{#each response}}
            &amp;lt;tr&amp;gt;
                &amp;lt;td&amp;gt;{{name}}&amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;{{email}}&amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
        {{/each}}
    &amp;lt;/table&amp;gt;
`;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then add the following code to pass the response data to render in the template string and instantiate the visualization.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Set visualizer
pm.visualizer.set(template, {
    // Pass the response body parsed as JSON as `data`
    response: pm.response.json()
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save your changes. And then send the call, and toggle over to the &lt;strong&gt;Visualize&lt;/strong&gt; tab of the response to see our table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewvho1i599krjb5c1fgu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewvho1i599krjb5c1fgu.png" alt="Visualize the response data&amp;lt;br&amp;gt;
" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Watch and learn
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/xyOIWGPUeR4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If you want to skip ahead to the finished product, fork this example collection and environment to your own workspace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://god.gw.postman.com/run-collection/13191452-9e1d8008-416a-476b-8e84-6650cfbd6f87?action=collection%2Ffork&amp;amp;collection-url=entityId%3D13191452-9e1d8008-416a-476b-8e84-6650cfbd6f87%26entityType%3Dcollection%26workspaceId%3D02d1963b-f4c4-49cc-bd6b-13f7015dd726#?env%5BMock%20data%5D=W3sia2V5IjoidXJsIiwidmFsdWUiOiJodHRwczovL2Y3OTNiYWU1LTliNjMtNGYzMC1iOWU3LTNkYTkwMTVhYmQ2Ny5tb2NrLnBzdG1uLmlvIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6InRleHQiLCJzZXNzaW9uVmFsdWUiOiJodHRwczovL2Y3OTNiYWU1LTliNjMtNGYzMC1iOWU3LTNkYTkwMTVhYmQ2Ny5tb2NrLnBzdG1uLmlvIiwic2Vzc2lvbkluZGV4IjowfV0=" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8g64ctk1yufk4tdzqzm.png" alt="fork the sample code" width="600" height="54"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next section, let’s dissect the JAM in this example, and think about ways to enhance each component.&lt;/p&gt;

&lt;h2&gt;
  
  
  A closer look at the JAM
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvv18qu2ww5t5t7ydgvwv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvv18qu2ww5t5t7ydgvwv.png" alt="elements of the JAM" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;&lt;br&gt;
The &lt;a href="https://learning.postman.com/docs/sending-requests/visualizer/" rel="noopener noreferrer"&gt;visualization&lt;/a&gt; is instantiated using the &lt;code&gt;pm.visualizer.set()&lt;/code&gt; function invoked in a test script. The &lt;a href="https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/" rel="noopener noreferrer"&gt;Postman sandbox&lt;/a&gt; provides access to other JavaScript functions and libraries that can be used in pre-request or test scripts. Furthermore, external CDN libraries can be imported using a function like &lt;code&gt;pm.sendRequest()&lt;/code&gt; among &lt;a href="https://community.postman.com/t/adding-external-libraries-to-postman/1971/6" rel="noopener noreferrer"&gt;other ways of using external libraries&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;APIs&lt;/strong&gt;&lt;br&gt;
We stored our data using a mock server hosted on Postman cloud, accessing the data with a call to our mock API. This allows us to quickly edit the data and “deploy” our updates by saving our changes to Postman. If we find a third-party service we like, or create our own custom API, we can swap out the API to call. In fact, we can call as many APIs as we wish, synthesize the data and perform calculations to create our own custom services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Markup&lt;/strong&gt;&lt;br&gt;
We visualized an HTML template string that can be styled with CSS. You can also use Handlebars templating language to generate HTML. If you don’t feel like writing your own Markup, search for &lt;a href="https://go.postman.co/search?q=visualizer&amp;amp;scope=all&amp;amp;type=all" rel="noopener noreferrer"&gt;other visualizations&lt;/a&gt; created by other members of the Postman community. And once again, external CDN libraries can be imported, this time using script tags within the template string.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extend this to production-level applications
&lt;/h2&gt;

&lt;p&gt;We did it! It is possible to develop, deploy, and host a complete Jamstack application in Postman. But this was a simplified example. At some point, you may choose to swap out your mock data with a third-party service or your own API hosted on serverless architecture. Or you may decide not to visualize the HTML in Postman, but in a web browser instead. There are a bunch of tools, technologies, and workflows to support your Jamstack applications.&lt;/p&gt;

&lt;p&gt;The Jamstack architecture lets you get creative with your implementation. JavaScript and APIs allow you to pull data dynamically with interactivity limited only by your imagination. And the thriving API economy means your options for this dynamic behavior are growing fast.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
