<?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: Phalgun Vaddepalli</title>
    <description>The latest articles on DEV Community by Phalgun Vaddepalli (@phalgunv).</description>
    <link>https://dev.to/phalgunv</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F818287%2F4212abdc-1db3-4be0-a6b9-79ccad387bc3.jpeg</url>
      <title>DEV Community: Phalgun Vaddepalli</title>
      <link>https://dev.to/phalgunv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/phalgunv"/>
    <language>en</language>
    <item>
      <title>3 Ways to Check the Angular Version in Your Browser (Even in Prod)</title>
      <dc:creator>Phalgun Vaddepalli</dc:creator>
      <pubDate>Wed, 12 Aug 2026 20:52:04 +0000</pubDate>
      <link>https://dev.to/phalgunv/3-ways-to-check-the-angular-version-in-your-browser-even-in-prod-iee</link>
      <guid>https://dev.to/phalgunv/3-ways-to-check-the-angular-version-in-your-browser-even-in-prod-iee</guid>
      <description>&lt;p&gt;When debugging an Angular application in the browser, verifying the exact version of the framework running under the hood is often the first step in troubleshooting.&lt;/p&gt;

&lt;p&gt;While you could always check your &lt;code&gt;package.json&lt;/code&gt;, sometimes you don't have access to the source code, or you need to confirm that the deployed build matches your expectations.&lt;/p&gt;

&lt;p&gt;Here are three ways to extract the Angular version directly from the browser, ranging from the absolute fastest methods to digging into optimized Webpack bundles.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. The Quickest Way: Inspect the DOM
&lt;/h3&gt;

&lt;p&gt;When Angular bootstraps an application, it automatically stamps the root component with the exact framework version. This is the fastest, most reliable method if the application has successfully rendered.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to do it:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your browser's &lt;strong&gt;Developer Tools&lt;/strong&gt; (&lt;code&gt;F12&lt;/code&gt; or right-click -&amp;gt; &lt;strong&gt;Inspect&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Elements&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Locate the root application tag (usually &lt;code&gt;&amp;lt;app-root&amp;gt;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Look for the &lt;code&gt;ng-version&lt;/code&gt; attribute.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You’ll see something like this: &lt;code&gt;&amp;lt;app-root ng-version="21.2.14"&amp;gt;&amp;lt;/app-root&amp;gt;&lt;/code&gt;. That's it!&lt;/p&gt;




&lt;h3&gt;
  
  
  2. The Console Approach: Querying the Version
&lt;/h3&gt;

&lt;p&gt;If you prefer keeping your hands on the keyboard and out of the Elements tree, you can use a quick JavaScript snippet in the console to pull the exact same attribute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to do it:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;strong&gt;Console&lt;/strong&gt; tab in your Developer Tools.&lt;/li&gt;
&lt;li&gt;Run the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[ng-version]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ng-version&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The console will return the version string, such as &lt;code&gt;"21.2.14"&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. The Deep Dive: Searching the Webpack Bundles
&lt;/h3&gt;

&lt;p&gt;Sometimes, you might need to inspect the actual JavaScript bundles—perhaps the app is failing to bootstrap, and the &lt;code&gt;&amp;lt;app-root&amp;gt;&lt;/code&gt; tag hasn't been stamped yet.&lt;/p&gt;

&lt;p&gt;Older tutorials will tell you to look for a &lt;code&gt;vendor.js&lt;/code&gt; file and search for &lt;code&gt;new Version(&lt;/code&gt;. However, in modern Angular configurations, this advice is often misleading.&lt;/p&gt;

&lt;p&gt;If your &lt;code&gt;angular.json&lt;/code&gt; has &lt;code&gt;vendorChunk&lt;/code&gt; set to &lt;code&gt;false&lt;/code&gt;, or if you are dealing with a build where optimization and output hashing are enabled, Angular doesn't split third-party libraries into a separate vendor file. Instead, everything is bundled into a hashed &lt;code&gt;main&lt;/code&gt; file, and the code is minified.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to find the version in optimized Webpack builds:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;strong&gt;Developer Tools&lt;/strong&gt; and navigate to the &lt;strong&gt;Sources&lt;/strong&gt; tab (or check the &lt;strong&gt;Network&lt;/strong&gt; tab for loaded JS).&lt;/li&gt;
&lt;li&gt;Look for your main application bundle. It will typically be named something like &lt;code&gt;main.[hash].js&lt;/code&gt; (e.g., &lt;code&gt;main.3b878c28634a75c9.js&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Open this file and press &lt;code&gt;Ctrl + F&lt;/code&gt; (or &lt;code&gt;Cmd + F&lt;/code&gt;) to open the in-file search.&lt;/li&gt;
&lt;li&gt;Because the code is minified, the &lt;code&gt;Version&lt;/code&gt; class has likely been aliased to a single letter (like &lt;code&gt;l&lt;/code&gt; or &lt;code&gt;e&lt;/code&gt;). Instead of searching for the full declaration, &lt;strong&gt;search for a partial match&lt;/strong&gt;:&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type &lt;code&gt;.Version("&lt;/code&gt; or &lt;code&gt;Version("&lt;/code&gt; into the search bar.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You will find a minified snippet that looks something like this:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Version&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;21.2.14&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The string inside the quotes is your Angular version.&lt;/p&gt;




&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Whether you are dealing with local development environments or heavily optimized production builds, knowing how to navigate the DOM and your Webpack bundles is a handy debugging skill. For quick checks, rely on the &lt;code&gt;ng-version&lt;/code&gt; attribute. For deeper bundle analysis, just remember to adjust your search terms to account for minification!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The invisible anchor: how `@if` breaks when you touch the DOM</title>
      <dc:creator>Phalgun Vaddepalli</dc:creator>
      <pubDate>Fri, 07 Aug 2026 14:01:52 +0000</pubDate>
      <link>https://dev.to/phalgunv/the-invisible-anchor-how-if-breaks-when-you-touch-the-dom-1ahk</link>
      <guid>https://dev.to/phalgunv/the-invisible-anchor-how-if-breaks-when-you-touch-the-dom-1ahk</guid>
      <description>&lt;p&gt;&lt;strong&gt;Angular 21 · 7 min read · August 7, 2026&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Angular's control-flow directives — &lt;code&gt;@if&lt;/code&gt;, &lt;code&gt;@for&lt;/code&gt;, &lt;code&gt;@switch&lt;/code&gt; — don't just add and remove elements. They leave behind invisible &lt;em&gt;anchor nodes&lt;/em&gt; in the DOM, and those anchors are the only way Angular knows where to put content back when a condition changes. If you destroy one, the directive silently breaks — and no error tells you.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an anchor node?
&lt;/h2&gt;

&lt;p&gt;When Angular compiles a template with &lt;code&gt;@if&lt;/code&gt;, it doesn't simply render or remove your element. It inserts a DOM comment node at the exact position where the conditional content should appear. This comment is the &lt;em&gt;anchor&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;When the condition is &lt;code&gt;true&lt;/code&gt;, Angular inserts the rendered content &lt;em&gt;before&lt;/em&gt; the anchor. When the condition flips to &lt;code&gt;false&lt;/code&gt;, Angular removes the content but &lt;em&gt;leaves the anchor in place&lt;/em&gt;. That way, when the condition becomes true again, Angular walks to the anchor and re-inserts the content at the correct position.&lt;/p&gt;

&lt;p&gt;You can see this for yourself in the demo app. &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__bolt"&gt;
  &lt;iframe src="https://angular-if-directive-kdbp.bolt.host" title="Bolt App" width="100%" height="600"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;
&lt;br&gt;
Toggle &lt;code&gt;show&lt;/code&gt; to false and look at the DOM inspector: the paragraph disappears, but a comment node remains. That comment is the anchor, and it's the whole reason the directive can restore content later.

&lt;h2&gt;
  
  
  When &lt;code&gt;appendChild()&lt;/code&gt; is safe
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;appendChild()&lt;/code&gt; adds a new node at the end of the parent's child list. Crucially, it &lt;em&gt;does not touch any existing children&lt;/em&gt;. The anchor comment stays right where it was. So after appending, the &lt;code&gt;@if&lt;/code&gt; directive still works: toggle the condition off and on, and the paragraph comes back exactly where it should.&lt;/p&gt;

&lt;p&gt;This is the key insight: &lt;strong&gt;adding nodes is safe; wiping nodes is not&lt;/strong&gt;. As long as you don't destroy the anchor, Angular's bookkeeping stays intact.&lt;/p&gt;

&lt;h2&gt;
  
  
  When &lt;code&gt;replaceChildren()&lt;/code&gt; breaks everything
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;replaceChildren()&lt;/code&gt; is more aggressive. It removes &lt;em&gt;every&lt;/em&gt; existing child of the element before inserting its arguments. That includes text nodes, element nodes — and comment nodes. The anchor is gone.&lt;/p&gt;

&lt;p&gt;Now flip &lt;code&gt;show&lt;/code&gt; to false. Angular removes the paragraph. Then flip it back to true. Angular looks for its anchor to know where to insert the content… and finds nothing. The directive can't place its content, so &lt;strong&gt;nothing renders&lt;/strong&gt;. No error is thrown. No warning is logged. The paragraph is simply gone, and the only way to get it back is to reload the page.&lt;/p&gt;

&lt;p&gt;This is what makes the bug so insidious: it's silent. Your application looks broken to the user, but the console is clean. You might spend hours checking your signals, your conditions, your change detection — all while the real problem is a missing DOM comment that was destroyed three interactions ago.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The same trap applies elsewhere&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;innerHTML = ''&lt;/code&gt;, &lt;code&gt;removeChild()&lt;/code&gt; on the wrong node, &lt;code&gt;textContent = ''&lt;/code&gt; — any operation that wipes a container's children will destroy anchor nodes. The &lt;code&gt;@for&lt;/code&gt; and &lt;code&gt;@switch&lt;/code&gt; directives use the same anchor mechanism, so they're equally vulnerable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How to recover without a page reload
&lt;/h2&gt;

&lt;p&gt;Once the anchor is destroyed, the &lt;code&gt;@if&lt;/code&gt; directive instance is permanently broken. You can't restore the anchor by setting the condition back to true — Angular has no way to recreate it. The only fix is to destroy and recreate the entire directive instance.&lt;/p&gt;

&lt;p&gt;In the demo, the Reset button does this by wrapping the host element in a &lt;code&gt;@for&lt;/code&gt; loop keyed on a counter. Each reset increments the counter, which forces Angular to tear down the old template — broken &lt;code&gt;@if&lt;/code&gt; and all — and build a fresh one with a brand-new anchor. The paragraph comes back immediately, no reload needed.&lt;/p&gt;

&lt;p&gt;In a real application, you'd rarely need this. The point is to understand what happened: the directive's internal state was corrupted by an external DOM mutation, and the only recovery is to let Angular rebuild that part of the view from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule
&lt;/h2&gt;

&lt;p&gt;Never call &lt;code&gt;replaceChildren()&lt;/code&gt;, &lt;code&gt;innerHTML = ''&lt;/code&gt;, or any wipe-and-replace operation on an element that Angular manages with control-flow directives. If you need to add content, use &lt;code&gt;appendChild()&lt;/code&gt;. If you need to remove content, let Angular handle it through its own reactive state. The DOM inside a directive-managed element is not yours to wipe — it's Angular's, and the anchors are load-bearing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;Modern Angular gives you powerful tools for directly manipulating the DOM when you need them — &lt;code&gt;ViewChild&lt;/code&gt;, &lt;code&gt;ElementRef&lt;/code&gt;, and raw browser APIs are all available. But with that power comes a contract: the DOM inside directive-managed regions is shared territory. Angular relies on invisible infrastructure — anchor comments, view containers, internal bookkeeping — that lives in the same DOM tree you're touching.&lt;/p&gt;

&lt;p&gt;The best defense is understanding what's under the hood. Once you know the anchor is there, you know why &lt;code&gt;appendChild()&lt;/code&gt; is safe and &lt;code&gt;replaceChildren()&lt;/code&gt; is not. And when something silently stops rendering, you'll know exactly where to look.&lt;/p&gt;

</description>
      <category>angular</category>
    </item>
    <item>
      <title>Exploring Chrome's Built-In AI APIs: A Hands-On Guide</title>
      <dc:creator>Phalgun Vaddepalli</dc:creator>
      <pubDate>Thu, 09 Jul 2026 21:05:22 +0000</pubDate>
      <link>https://dev.to/phalgunv/chrome-built-in-ai-apis-a-hands-on-guide-to-language-detection-translation-summarization-and-114k</link>
      <guid>https://dev.to/phalgunv/chrome-built-in-ai-apis-a-hands-on-guide-to-language-detection-translation-summarization-and-114k</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Chrome's Built-In AI APIs allow web applications to perform selected AI tasks using models managed by the browser.&lt;/p&gt;

&lt;p&gt;Unlike traditional cloud-based AI integrations, developers do not need to deploy or operate separate model infrastructure for these workloads.&lt;/p&gt;

&lt;p&gt;This guide introduces the major Built-In AI APIs and provides small examples of each API. Complete runnable examples are linked separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Chrome's Built-In AI APIs are at different stages of availability. The Language Detector, Translator, and Summarizer APIs are available in stable Chrome on supported desktop devices, while other APIs have different availability and testing requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enabling Experimental APIs for Local Testing
&lt;/h3&gt;

&lt;p&gt;The required setup depends on the API and Chrome version being tested.&lt;/p&gt;

&lt;p&gt;During local testing with Chrome 149, the following flags were enabled:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chrome://flags/#optimization-guide-on-device-model
chrome://flags/#prompt-api-for-gemini-nano
chrome://flags/#prompt-api-for-gemini-nano-multimodal-input
chrome://flags/#writer-api-for-gemini-nano
chrome://flags/#proofreader-api-for-gemini-nano
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After changing Chrome flags, fully relaunch the browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Chrome's Built-In AI APIs are evolving. Check the current Chrome documentation for the release status and setup requirements of the specific API you are using rather than assuming that every API requires the same configuration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Language Detector API
&lt;/h2&gt;

&lt;p&gt;The Language Detector API identifies the language of a given text.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic localization&lt;/li&gt;
&lt;li&gt;Query routing&lt;/li&gt;
&lt;li&gt;Analytics&lt;/li&gt;
&lt;li&gt;Content classification&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;detector&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;LanguageDetector&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;detector&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;detect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bonjour tout le monde&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Complete runnable example:&lt;/strong&gt; &lt;a href="https://gist.github.com/phalgunv/b68fcbc90950796c2d9230238458622a" rel="noopener noreferrer"&gt;Language Detector API on GitHub Gist&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Translator API
&lt;/h2&gt;

&lt;p&gt;The Translator API translates text between supported languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Localization&lt;/li&gt;
&lt;li&gt;User-generated content translation&lt;/li&gt;
&lt;li&gt;Multilingual applications&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;translator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Translator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;sourceLanguage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;targetLanguage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ar&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;translator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, world!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Complete runnable example:&lt;/strong&gt; &lt;a href="https://gist.github.com/phalgunv/94faf9cb278c1f0086af26ad4ea38947" rel="noopener noreferrer"&gt;Translator API on GitHub Gist&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Summarizer API
&lt;/h2&gt;

&lt;p&gt;The Summarizer API generates summaries of text.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Release notes&lt;/li&gt;
&lt;li&gt;Article digests&lt;/li&gt;
&lt;li&gt;Document summaries&lt;/li&gt;
&lt;li&gt;Knowledge management&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;summarizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Summarizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;key-points&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;short&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;summarizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;longText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Complete runnable example:&lt;/strong&gt; &lt;a href="https://gist.github.com/phalgunv/388be680584070b42fd03a491648f196" rel="noopener noreferrer"&gt;Summarizer API on GitHub Gist&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prompt API
&lt;/h2&gt;

&lt;p&gt;The Prompt API provides access to Gemini Nano for general-purpose inference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Metadata extraction&lt;/li&gt;
&lt;li&gt;Classification&lt;/li&gt;
&lt;li&gt;Structured output generation&lt;/li&gt;
&lt;li&gt;Lightweight reasoning&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;LanguageModel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Extract structured data from this text.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Complete runnable example:&lt;/strong&gt; &lt;a href="https://gist.github.com/phalgunv/e957a18e7566c7a1ca9942954b0e3b3c" rel="noopener noreferrer"&gt;Prompt API on GitHub Gist&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Writer API
&lt;/h2&gt;

&lt;p&gt;The Writer API generates new content based on an input prompt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Email drafts&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;Support responses&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;tone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;neutral&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;short&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Write a short introduction to browser-based AI.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Complete runnable example:&lt;/strong&gt; &lt;a href="https://gist.github.com/phalgunv/b637ccbe54c7f76e1a1ebc814be34fa4" rel="noopener noreferrer"&gt;Writer API on GitHub Gist&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Rewriter API
&lt;/h2&gt;

&lt;p&gt;The Rewriter API transforms existing content.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Incident reports&lt;/li&gt;
&lt;li&gt;User reviews&lt;/li&gt;
&lt;li&gt;Internal communications&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rewriter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Rewriter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;tone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;more-formal&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;rewriter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rewrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;We fixed the issue and everything looks good now.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Complete runnable example:&lt;/strong&gt; &lt;a href="https://gist.github.com/phalgunv/e21ac95d9b525d631d2459a456d4b5d8" rel="noopener noreferrer"&gt;Rewriter API on GitHub Gist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Streaming UI example:&lt;/strong&gt; &lt;a href="https://gist.github.com/phalgunv/0e0001c6eac2be1c8712a2be066944f0" rel="noopener noreferrer"&gt;Rewriter Streaming on GitHub Gist&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Proofreader API
&lt;/h2&gt;

&lt;p&gt;The Proofreader API checks text for writing errors and provides suggested corrections.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Documentation review&lt;/li&gt;
&lt;li&gt;Content publishing&lt;/li&gt;
&lt;li&gt;User-generated content&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;proofreader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Proofreader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;proofreader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;proofread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This sentence have a grammatical error.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Complete runnable example:&lt;/strong&gt; &lt;a href="https://gist.github.com/phalgunv/840d4c5adc3f560909a9d683ae291fdf" rel="noopener noreferrer"&gt;Proofreader API on GitHub Gist&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Security Considerations
&lt;/h2&gt;

&lt;p&gt;On-device inference changes where computation occurs, but it does not eliminate application security risks.&lt;/p&gt;

&lt;p&gt;AI-generated output should be treated as untrusted data and validated using the same rigor applied to other untrusted input.&lt;/p&gt;

&lt;p&gt;Do not execute generated code or render generated HTML without appropriate validation and sanitization. AI-generated output should also not be trusted to make security-sensitive decisions such as authorization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Chrome's Built-In AI APIs are a practical way to experiment with browser-managed inference.&lt;/p&gt;

&lt;p&gt;Task-specific APIs such as translation, language detection, and summarization are particularly well suited to browser-managed inference. For workloads that require broader capabilities or consistent availability across browsers and devices, cloud-hosted models remain an important option, leading to a hybrid approach where local and remote inference coexist.&lt;/p&gt;

&lt;p&gt;The most practical architecture is often a hybrid one: use browser-managed AI when the required capability is available, fall back to cloud services when broader capabilities are needed, and use deterministic logic when AI is unnecessary.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>chrome</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
