<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David Fagbuyiro on Medium]]></title>
        <description><![CDATA[Stories by David Fagbuyiro on Medium]]></description>
        <link>https://medium.com/@davidfagb?source=rss-d1058d8a6759------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tQTjIfY643Gzl6ovvctb4A.jpeg</url>
            <title>Stories by David Fagbuyiro on Medium</title>
            <link>https://medium.com/@davidfagb?source=rss-d1058d8a6759------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 23:13:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@davidfagb/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Beginner’s Guide to API Security With Kotlin and Spring Boot]]></title>
            <link>https://medium.com/@davidfagb/a-beginners-guide-to-api-security-with-kotlin-and-spring-boot-4aaf29e4e360?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/4aaf29e4e360</guid>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 20:34:15 GMT</pubDate>
            <atom:updated>2026-11-16T20:34:15.386Z</atom:updated>
            <content:encoded><![CDATA[<p>The tutorial Secure Your APIs: OAuth2 and JWT for Beginners explains how to protect Kotlin and Spring Boot APIs using OAuth2 and JSON Web Tokens. It clarifies the difference between authentication and authorization, then walks through securing a document API with token validation and scope checks. It also covers roles, permissions, and checks that confirm tokens come from a trusted issuer and are intended for the API. The tutorial is useful for developers with basic Kotlin and Spring Boot knowledge who want practical experience with API security. As a technical writer, I could use these concepts to create clearer API documentation explaining bearer tokens, required permissions, and why an access request might fail.</p><p>Read the <a href="https://blog.jetbrains.com/kotlin/2026/07/secure-your-apis-oauth2-and-jwt-for-beginners/?utm_source=blog&amp;utm_medium=referral&amp;utm_campaign=influencer_distribution&amp;utm_content=kotlin_oauth2_jwt">full tutorial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4aaf29e4e360" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scraping Static HTML vs. Using an API: How to Choose]]></title>
            <link>https://medium.com/@davidfagb/scraping-static-html-vs-using-an-api-how-to-choose-10670a4d06da?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/10670a4d06da</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 11:17:44 GMT</pubDate>
            <atom:updated>2026-11-11T11:17:44.893Z</atom:updated>
            <content:encoded><![CDATA[<p>You build a price tracker, and your scraper works perfectly until the website changes its layout. While fixing it, you discover an API that provides the same data.</p><p>Should you switch? It depends on what the API offers, what it costs, and how often you need updates. Here’s how to choose between static HTML scraping and an API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*txlHM-aU7_-7g9nRIB9i3Q.png" /><figcaption>Cover image for Scraping Static HTML vs. Using an API: How to Choose</figcaption></figure><h3>What is static HTML scraping?</h3><p>Static HTML scraping means downloading a page’s HTML and extracting information from its elements. The required data must already be present in the server’s response, so you do not need to run JavaScript to retrieve it.</p><p>For example, a product page might contain:</p><pre>&lt;article class=&quot;product&quot;&gt;<br>  &lt;h2 class=&quot;name&quot;&gt;Wireless Keyboard&lt;/h2&gt;<br>  &lt;span class=&quot;price&quot;&gt;$49.99&lt;/span&gt;<br>&lt;/article&gt;</pre><p>A parser can locate the product name and price using their tags or CSS classes. Python’s Beautiful Soup supports this through methods such as select() and select_one().</p><p>The word “static” describes how you collect the content. A server can generate the HTML dynamically and still return everything your scraper needs. MDN explains how servers build HTML from stored data before sending it to the browser.</p><p>If the price appears only after JavaScript runs, downloading and parsing the initial HTML will not capture it. You will need another approach, such as a supported API or browser rendering.</p><h3>What does using an API involve?</h3><p>An API gives your program a defined way to request data. Instead of locating a price inside a page element, you read it from a response field.</p><p>A hypothetical product API might return:</p><pre>{<br>  &quot;id&quot;: &quot;keyboard-101&quot;,<br>  &quot;name&quot;: &quot;Wireless Keyboard&quot;,<br>  &quot;price&quot;: 49.99,<br>  &quot;currency&quot;: &quot;USD&quot;<br>}</pre><p>JSON is a common format for exchanging structured data, although APIs can use other formats. Its named fields make it straightforward to distinguish values such as a product’s price and currency.</p><p>Before building around an API, check its documentation. Confirm which records and fields it exposes, whether authentication is required, and how pagination and request limits work.</p><h3>How the two approaches compare</h3><p>Static HTML scraping extracts data from a webpage’s structure, while an API provides data through a defined interface. Here’s how they compare:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*wKmh8Q1JlFlSt9moKee3NQ.png" /><figcaption>Scraping Static HTML vs. Using an API: How to Choose</figcaption></figure><p><strong>Key Takeaway:</strong> While static HTML scraping offers flexibility without relying on official developer access, it comes with higher maintenance overhead due to website structural updates. Official APIs provide standardized, structured records but require adherence to rate limits, authentication protocols, and potential pricing models.</p><h3>When to choose an API</h3><p>Choose an official API when it exposes the required data and supports your intended use.</p><p>This is especially useful for recurring integrations. A price tracker, for example, benefits from explicit product identifiers, numeric prices, currency fields, and documented pagination. These reduce the amount of interpretation your code needs to perform.</p><p>Check request limits before estimating capacity. GitHub, for example, documents both primary and secondary API limits, with rules that depend partly on authentication. An API is a managed interface, not unlimited access.</p><p>Also check freshness. An endpoint that returns yesterday’s prices will not meet a requirement for current prices, even if its response is easy to process.</p><h3>When to choose static HTML scraping</h3><p>Choose static HTML scraping when the required information is present in the initial response, no suitable API covers the task, and the website’s rules permit the collection.</p><p>Consider a directory that publishes organization names and website links in simple HTML. If you only need an occasional update, downloading those pages and extracting the relevant elements may be sufficient.</p><p>Before committing, inspect the actual response body. Seeing information in the browser does not prove it was included in the initial HTML.</p><p>Then test several pages. Check records with missing fields, different layouts, and multiple price values. A selector that works for one product may accidentally capture a discount label or delivery charge on another.</p><p>Build validation into the collector. Missing required fields, unexpected record counts, and invalid values should trigger a visible failure rather than silently entering your dataset.</p><h3>Consider the total cost</h3><p>Compare the effort required over the project’s lifetime.</p><p>For scraping, include page discovery, parsing, cleanup, monitoring, and repairs. For an API, include access approval, subscription fees, pagination, quota management, and version updates.</p><p>A paid API may cost less overall if it avoids frequent maintenance. A small HTML scraper may be more practical for an occasional collection task when API access is expensive or unavailable.</p><p>You can also combine the approaches when permitted. For example, an API might provide product identifiers and prices while public HTML pages provide descriptions. Check that the records refer to the same product and that their update times are compatible.</p><h3>A practical way to decide</h3><p>Use this sequence before writing the full integration:</p><ol><li><strong>Define the dataset.</strong> Specify the fields, record count, update frequency, and acceptable delay.</li><li><strong>Evaluate the official API.</strong> Check coverage, access, pricing, quotas, and permitted use.</li><li><strong>Inspect the HTML response.</strong> Confirm whether it contains anything the API cannot provide.</li><li><strong>Build a small proof of concept.</strong> Test representative records and estimate ongoing maintenance.</li></ol><p>For a daily product feed, a documented API with sufficient coverage is usually the stronger starting point. For an occasional collection from simple pages without an API, static HTML scraping may be enough.</p><p>Choose the method that delivers the required data consistently, within the source’s access rules, at a cost you can maintain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10670a4d06da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agents vs Chatbots: What Is the Difference?]]></title>
            <link>https://medium.com/@davidfagb/ai-agents-vs-chatbots-what-is-the-difference-b89b0c6daef0?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/b89b0c6daef0</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[langchain-agents]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 11:30:54 GMT</pubDate>
            <atom:updated>2026-08-05T11:42:55.518Z</atom:updated>
            <content:encoded><![CDATA[<p>Chatbots have been the standard way businesses use AI for customer interactions. They answer questions, provide support, and automate simple conversations. However, AI agents are becoming more popular because they go beyond basic responses.</p><p>While both can understand natural language, the key difference is how they operate. Chatbots mainly respond to requests, while AI agents can understand goals, make decisions, use tools, and complete tasks with less human input. This distinction matters as many products now use the term “AI agent” for what are actually advanced chatbots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mhgK_nRABJ_l971vdHkZGg.png" /><figcaption>Main article cover picture</figcaption></figure><h4>What Is a Chatbot?</h4><p>A chatbot is an AI system designed to communicate with users through text or voice. Traditional chatbots rely on predefined rules, matching user questions like “Where is my order?” or “How do I reset my password?” with stored responses.</p><p>Modern AI chatbots powered by large language models are more advanced. They can understand context, generate responses, summarize information, and handle more complex conversations.</p><p>However, most chatbots still follow a simple pattern: <strong>User asks → AI responds → Conversation ends</strong>. They are mainly built for communication rather than taking independent actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*99XTGuv8chkaNMbdTjNfIw.png" /><figcaption>chatbots description</figcaption></figure><h4>What Is an AI Agent?</h4><p>An AI agent is a system designed to achieve a goal by taking actions, not just answering questions. It can understand objectives, create plans, use external tools, make decisions, complete multiple steps, and adjust based on results.</p><blockquote>For example, if you ask an AI agent to find the cheapest flight to London next month and create a travel plan, it could search flight databases, compare options, check schedules, and organize the results. A chatbot would typically only provide suggestions or information.</blockquote><p>The main difference is that chatbots focus on conversation, while AI agents focus on completing tasks. A chatbot responds with information, while an AI agent works toward a goal. However, chatbots can also serve as the interface users use to interact with AI agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1jYv9pLPO4SyYzxt5wHPQ.png" /><figcaption>AI-Agents description</figcaption></figure><h4>How AI Agents Work Differently</h4><p>Most AI agents are built from several components working together. The first is a language model that helps the agent understand instructions and generate responses. The second is memory, which allows the agent to remember past tasks, preferences, or workflows beyond the current conversation.</p><p>The third component is tool usage, which allows agents to connect with APIs, databases, search engines, and software applications. This gives them the ability to perform actions instead of only generating text.</p><blockquote>For example, a business AI agent can read emails, identify customer requests, check order details, create responses, and update records automatically. This ability to interact with external systems is what makes AI agents more powerful than traditional chatbots.</blockquote><h4>Real World Examples</h4><p>A chatbot can help customers find product information, while an AI agent can manage the entire support process by understanding issues, checking accounts, finding solutions, and creating tickets.</p><p>In software development, chatbots can explain code and answer questions, but AI coding agents can analyze projects, write code, run tests, fix bugs, and suggest improvements.</p><p>For business operations, chatbots can summarize reports, while AI agents can collect data from multiple sources, analyze performance, and provide recommendations.</p><h4>Why AI Agents Are Becoming Popular</h4><p>The growth of AI agents is driven by advances in large language models and their ability to connect with external tools. Earlier AI systems could only generate text, meaning they could explain concepts but could not take actions or interact with other systems.</p><p>Modern AI agents can access applications, process information, and complete tasks. This transforms AI from a simple question answering tool into a digital assistant that can manage workflows.</p><p>Businesses are now exploring AI agents across areas such as customer support, sales, research, software development, and automation to improve efficiency and reduce manual work.</p><h4>AI Agent vs Chatbot Comparison</h4><p>Here is a direct comparison highlighting the key differences between traditional chatbots and autonomous AI agents across core capabilities and workflow functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JCuC4LuIciZmfEE9gqbLlQ.png" /><figcaption>AI Agent vs Chatbot Comparison</figcaption></figure><h4>Are AI Agents Better Than Chatbots?</h4><p>Not always. The right choice depends on the problem you are trying to solve.</p><p>A chatbot is often the better option for simple communication tasks, such as answering FAQs or helping users navigate a website. An AI agent is more useful when a task requires multiple steps, decision making, or interaction with other systems.</p><p>However, AI agents add more complexity. Developers need to consider reliability, security, permissions, and how much independence the system should have. Giving an AI system the ability to take actions requires stronger controls than simply generating text.</p><h4>The Future of AI Assistants</h4><p>The line between chatbots and AI agents will continue to blur. Future AI assistants will combine natural conversations with the ability to complete tasks, making them more useful in everyday workflows.</p><p>For developers, the shift is moving from building systems that only generate responses to creating AI that understands goals, makes decisions, and takes actions safely.</p><h4>Final Thoughts</h4><p>The main difference between AI agents and chatbots comes down to their purpose. Chatbots are built primarily for conversation. They respond to questions, provide information, and help users find answers through text or voice interactions. AI agents go a step further by taking information, making decisions, and performing actions to complete specific tasks. While a chatbot might explain how to book a flight, an AI agent could search for available options, compare prices, and help complete the booking process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b89b0c6daef0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Future of Work: Will AI Agents Become Every Employee’s Digital Teammate?]]></title>
            <link>https://medium.com/@davidfagb/the-future-of-work-will-ai-agents-become-every-employees-digital-teammate-d6a656220f23?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6a656220f23</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Fri, 05 Jun 2026 15:43:46 GMT</pubDate>
            <atom:updated>2026-06-05T15:43:46.934Z</atom:updated>
            <content:encoded><![CDATA[<p>The workplace is changing faster than ever. A few years ago, artificial intelligence (AI) was mainly used for answering questions, generating content, or analyzing data. Today, a new type of AI is emerging: <strong>AI agents</strong>.</p><p>Unlike traditional AI tools, AI agents can perform tasks, make decisions, and work across multiple systems with little human guidance. This raises an important question:</p><blockquote><strong>Will AI agents become every employee’s digital teammate?</strong></blockquote><blockquote>The answer is looking more likely every day.</blockquote><h3>What Are AI Agents?</h3><p>An AI agent is a software system that can understand goals, plan actions, use tools, and complete tasks on behalf of a user.</p><p>For example, instead of simply helping you write an email, an AI agent could:</p><ul><li>Read incoming emails</li><li>Identify urgent requests</li><li>Draft responses</li><li>Schedule meetings</li><li>Update your CRM system</li><li>Send follow-up messages</li></ul><p>All of this can happen with minimal human involvement.</p><p>Think of AI agents as virtual coworkers that handle repetitive and time-consuming tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8pN5AdhCkOAD2rAgFwIYyA.png" /><figcaption><strong>employee working alongside an AI assistant on a computer dashboard</strong></figcaption></figure><h3>Why AI Agents Are Different from Traditional Automation</h3><p>Businesses have used automation for years. However, traditional automation follows fixed rules.</p><p>For example:</p><ul><li>If a customer fills out a form, send an email.</li><li>If inventory is low, create a purchase order.</li></ul><p>AI agents go beyond predefined rules.</p><p>They can:</p><ul><li>Understand context</li><li>Learn from information</li><li>Make recommendations</li><li>Adapt to changing situations</li><li>Work across different software platforms</li></ul><p>This flexibility makes them far more powerful than traditional automation tools.</p><h3>How AI Agents Are Already Changing Work</h3><p>Many organizations are already using AI agents to improve productivity.</p><h3>Customer Service</h3><p>AI agents can answer customer questions, resolve common issues, and escalate complex cases to human representatives.</p><p>This reduces wait times and improves customer satisfaction.</p><h3>Marketing</h3><p>Marketing teams use AI agents to:</p><ul><li>Generate content ideas</li><li>Analyze campaign performance</li><li>Research competitors</li><li>Create reports</li></ul><p>This allows marketers to focus on strategy and creativity.</p><h3>Sales</h3><p>Sales professionals are using AI agents to:</p><ul><li>Find potential customers</li><li>Personalize outreach</li><li>Schedule meetings</li><li>Update customer records</li></ul><p>As a result, sales teams spend more time building relationships and less time on administrative work.</p><h3>Human Resources</h3><p>HR departments are using AI agents to:</p><ul><li>Screen resumes</li><li>Schedule interviews</li><li>Answer employee questions</li><li>Manage onboarding processes</li></ul><p>This speeds up hiring and improves employee experiences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCNbY8r0LpQs8Bk_ks1G1Q.png" /><figcaption><strong>AI agent assisting teams across sales, marketing, customer support, and HR.</strong></figcaption></figure><h3>The Rise of Digital Teammates</h3><p>In the future, employees may have their own AI teammate, imagine starting your workday and assigning tasks to an AI agent:</p><ul><li>Prepare a report on last month’s sales.”</li><li>“Schedule meetings with our top clients.”</li><li>“Research new market opportunities.”</li></ul><p>While you focus on decision-making and relationship-building, your AI teammate handles the routine work. This could significantly increase productivity across industries.</p><p>Instead of replacing workers, AI agents may help employees accomplish more in less time.</p><h3>Benefits of AI Agents in the Workplace</h3><h3>Increased Productivity</h3><p>Employees spend countless hours on repetitive tasks.</p><p>AI agents can automate many of these activities, allowing workers to focus on higher-value work.</p><h3>Faster Decision-Making</h3><p>AI agents can gather information, analyze data, and provide recommendations in seconds.</p><p>This helps organizations respond more quickly to opportunities and challenges.</p><h3>Reduced Operational Costs</h3><p>Businesses can automate processes that previously required significant manual effort.</p><p>This can reduce costs while improving efficiency.</p><h3>Better Employee Experience</h3><p>When repetitive tasks are removed, employees can focus on creative, strategic, and meaningful work.</p><p>This often leads to greater job satisfaction.</p><h3>Challenges Businesses Must Address</h3><p>Despite their potential, AI agents are not perfect.</p><p>Several challenges remain.</p><h3>Trust and Reliability</h3><p>AI agents can make mistakes.</p><p>Organizations must ensure that critical decisions still receive human oversight.</p><h3>Data Privacy</h3><p>AI agents often access large amounts of company data.</p><p>Strong security measures are necessary to protect sensitive information.</p><h3>Employee Concerns</h3><p>Many workers worry that AI could replace jobs.</p><p>Businesses must communicate clearly about how AI will be used and invest in employee training.</p><h3>Governance and Compliance</h3><p>Organizations needs clear rules regarding how AI agents make decisions and interact with business systems.</p><p><strong>[Insert Image Here: Business leaders reviewing AI governance, security, and compliance policies.]</strong></p><h3>What Skills Will Matter Most in the AI Era?</h3><p>As AI agents become more capable, human skills will become even more valuable.</p><p>Future employees will need skills such as:</p><ul><li>Critical thinking</li><li>Creativity</li><li>Leadership</li><li>Communication</li><li>Problem-solving</li><li>Emotional intelligence</li></ul><p>AI can process information quickly, but it cannot fully replace human judgment, empathy, and innovation.</p><p>The most successful professionals will learn how to work effectively alongside AI agents.</p><h3>Will AI Agents Replace Employees?</h3><p>This is one of the most common questions about AI.</p><p>While some tasks will become automated, history shows that new technologies often create new opportunities alongside disruption.</p><p>AI agents are more likely to transform jobs than eliminate them entirely.</p><p>Many roles will evolve rather than disappear.</p><p>Employees who learn to use AI effectively may become significantly more productive and valuable in their organizations.</p><h3>The Future Is Human Plus AI</h3><p>The future of work is unlikely to be humans versus AI. Instead, it will be humans working with AI.</p><p>AI agents are rapidly moving from experimental technology to practical business tools. As their capabilities improve, they may become as common in the workplace as email, spreadsheets, and video conferencing.</p><p>The organizations that embrace this shift responsibly will gain a competitive advantage.</p><p>And the employees who learn to collaborate with AI agents may find themselves leading the next generation of work.</p><h3>Final Thoughts</h3><p>AI agents are not just another technology trend. They represent a fundamental shift in how work gets done. As businesses continue adopting AI-powered tools, the concept of a digital teammate is becoming a reality.</p><blockquote>The question is no longer whether AI agents will enter the workplace, The real question is: <strong>How prepared are we to work alongside them?</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6a656220f23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Group Chat with Moderation Using React Native]]></title>
            <link>https://medium.com/@davidfagb/how-to-build-a-group-chat-with-moderation-using-react-native-6c25c2ec595c?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c25c2ec595c</guid>
            <category><![CDATA[messaging]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Mon, 03 Nov 2025 12:43:29 GMT</pubDate>
            <atom:updated>2025-11-03T12:43:29.136Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4tILuPZJoREGftil" /></figure><p>Building a safe and respectful group chat experience is more important than ever, especially in <a href="https://getstream.io/blog/video-game-chat-moderation/">online gaming communities</a> where conversations can scale quickly. A dedicated group moderator can make this easier by enforcing community standards, reducing toxic behavior, and keeping discussions welcoming for everyone.</p><p>With Stream’s AI Moderation built into the Chat API, moderation becomes even more seamless by automatically detecting harmful messages, filtering profanity, and supporting moderators in creating a positive environment for players.</p><blockquote>In this guide, you’ll learn how to combat a toxic community by building a group chat with an AI chat moderator. You’ll implement it using Stream’s <a href="https://getstream.io/moderation/">AI Moderation Service</a>, <a href="https://getstream.io/chat/">Chat API</a>, and <a href="https://getstream.io/chat/sdk/react-native/">React Native SDK</a> to review user messages and actively monitor them for harmful content. The goal isn’t to police users but to create a space where they can engage freely without worrying about spam, hate speech, or toxic behavior.</blockquote><h3>Prerequisites</h3><p>For this tutorial, you will need:</p><ul><li><a href="https://nodejs.org/en">Node.js</a> and <a href="https://docs.npmjs.com/">npm</a> are installed.</li><li><a href="https://www.npmjs.com/package/@react-native-community/cli">React Native CLI</a> installed.</li><li>A <a href="https://getstream.io/try-for-free/">free Stream account</a> to get your API key and secret.</li><li>An <a href="https://ngrok.com/">Ngrok</a> account to expose your local server to Stream webhooks.</li></ul><h3>Building the Group Chat</h3><blockquote>Once you’ve completed all the prerequisites, you’ll set up a basic group chat app using React Native and Stream. This app will include the essential components for a chat experience: a channel list, a message list, a message composer, and a new group creation flow.</blockquote><p>Start by creating a new folder to store all your project files. A good place for this is your desktop, as it’s easy to access. Inside this folder, create a new file named \.env\.</p><p>Next, copy and paste the following code into your newly created \.env\ file. This file will hold important configuration details for your app and token server.</p><pre>STREAM\_KEY=YOUR\_STREAM\_KEY  <br>STREAM\_SECRET=YOUR\_STREAM\_SECRET  <br>PORT=5050  </pre><p>The \.env\ file is where you save your Stream credentials, which consists of your Stream key and your Stream secret key found on your account dashboard, as seen in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qLA1r55JYQ88uGM8" /></figure><p>Create a new file called \server.js\ in the main project folder. Then, please copy and paste the following code into it.</p><pre>import &#39;dotenv/config&#39;;<br>import express from &#39;express&#39;;<br>import cors from &#39;cors&#39;;<br>import { StreamChat } from &#39;stream-chat&#39;;<br><br>const app = express();<br><br>app.use(cors());<br>app.use(express.json());<br><br>const STREAM_KEY = process.env.STREAM_KEY;<br>const STREAM_SECRET = process.env.STREAM_SECRET;<br>const PORT = process.env.PORT || 5050;<br><br>if (!STREAM_KEY || !STREAM_SECRET) {<br>  console.error(&#39;Missing STREAM_KEY or STREAM_SECRET in .env&#39;);<br>  process.exit(1);<br>}<br><br>const serverClient = StreamChat.getInstance(STREAM_KEY, STREAM_SECRET);<br><br>app.post(&#39;/token&#39;, async (req, res) =&gt; {<br>  try {<br>    const { user_id } = req.body || {};<br><br>    if (!user_id) {<br>      return res.status(400).json({ error: &#39;user_id required&#39; });<br>    }<br><br>    const token = serverClient.createToken(user_id);<br>    await serverClient.upsertUser({ id: user_id, name: user_id });<br><br>    res.json({<br>      token,<br>      user: { id: user_id, name: user_id },<br>      api_key: STREAM_KEY<br>    });<br>  } catch (err) {<br>    console.error(err);<br>    res.status(500).json({ error: &#39;failed_to_issue_token&#39; });<br>  }<br>});<br><br>app.listen(PORT, () =&gt; {<br>  console.log(`Token server running at http://localhost:${PORT}`);<br>});</pre><p>Create another file called \package.json\ in the main project folder. Then, copy and paste the following code into it.</p><pre>{<br><br>  &quot;name&quot;: &quot;chat-token-server&quot;,<br><br>  &quot;private&quot;: true,<br><br>  &quot;type&quot;: &quot;module&quot;,<br><br>  &quot;dependencies&quot;: {<br><br>    &quot;cors&quot;: &quot;^2.8.5&quot;,<br><br>    &quot;dotenv&quot;: &quot;^16.4.5&quot;,<br><br>    &quot;express&quot;: &quot;^4.19.2&quot;,<br><br>    &quot;stream-chat&quot;: &quot;^9.18.1&quot;<br><br>  },<br><br>  &quot;scripts&quot;: {<br><br>    &quot;start&quot;: &quot;node index.js&quot;<br><br>  }<br><br>}</pre><h3>Creating a New React Native Project</h3><p>After setting up your \server.js\ and \.env\ files, you’ll need to create the group chat&#39;s user interface.</p><p>To build the UI, go to your main project folder and create a new React Native project. You can do this by running the following commands in your terminal from the project’s root folder.</p><pre>npx create-expo-app rn-stream-chat</pre><h3>Installing Necessary Dependencies</h3><p>Next, you’ll install the <a href="https://getstream.io/chat/sdk/react-native/">Stream Chat React Native SDK</a> and its dependencies.</p><pre>cd rn-stream-chat<br><br>npm i stream-chat stream-chat-react-native react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg</pre><blockquote>​​Note that the RN SDK wraps the JS client and keeps versions compatible. The Stream Docs warn against manually installing stream-chat to avoid version skew, but if you do, pin to a compatible version and don’t duplicate it. If you hit weird client issues, remove your explicit stream-chat dep and let the RN SDK supply it.</blockquote><p>Create a <a href="https://github.com/Davidfagb/Group-chat-with-Stream-and-ReactNative">file</a> named babel.config.js and paste the code below into it.</p><pre>module.exports \= function(api) {<br><br>  api.cache(true);<br><br>  return {<br><br>    presets: \[&#39;babel-preset-expo&#39;\],<br><br>    plugins: \[&#39;react-native-reanimated/plugin&#39;\],<br><br>  };<br><br>};</pre><p>Create a new folder called src to store your project files. Inside src, add a subfolder named stream, then create a file called client.ts and paste the following code into it.</p><pre>import { StreamChat } from &#39;stream-chat&#39;;<br><br>let client: StreamChat | null \= null;<br><br>export function getStreamClient(apiKey: string) {<br><br>  if (\!client) client \= StreamChat.getInstance(apiKey);<br><br>  return client;<br><br>}</pre><p>Next, you will create a new folder inside the \src\ folder named \screens\, then create a file \/LoginScreen.tsx\, and paste the code below inside.</p><pre>import React, { useState } from &#39;react&#39;;<br><br>import { View, Text, TextInput, Button, Alert, Platform } from &#39;react-native&#39;;<br><br>type Props \= {<br><br>  onLoggedIn: (args: { userId: string, token: string, apiKey: string }) \=\&gt; void;<br><br>};<br><br>export default function LoginScreen({ onLoggedIn }: Props) {<br><br>  const \[userId, setUserId\] \= useState(&#39;joel&#39;);<br><br>  const \[serverUrl, setServerUrl\] \= useState(<br><br>    Platform.select({ ios: &#39;http://127.0.0.1:5050&#39;, default: &#39;http://10.0.2.2:5050&#39; })\!<br><br>  );<br><br>  const login \= async () \=\&gt; {<br><br>    try {<br><br>      const res \= await fetch(\`${serverUrl}/token\`, {<br><br>        method: &#39;POST&#39;,<br><br>        headers: { &#39;Content-Type&#39;: &#39;application/json&#39; },<br><br>        body: JSON.stringify({ user\_id: userId })<br><br>      });<br><br>      const data \= await res.json();<br><br>      if (\!res.ok) throw new Error(data?.error || &#39;Failed&#39;);<br><br>      onLoggedIn({ userId, token: data.token, apiKey: data.api\_key });<br><br>    } catch (e:any) {<br><br>      Alert.alert(&#39;Login failed&#39;, e.message);<br><br>    }<br><br>  };<br><br>  return (<br><br>    \&lt;View style={{ flex: 1, padding: 20, gap: 12, justifyContent: &#39;center&#39; }}\&gt;<br><br>      \&lt;Text style={{ fontSize: 22, fontWeight: &#39;600&#39; }}\&gt;Sign in\&lt;/Text\&gt;<br><br>      \&lt;Text\&gt;Pick a username (must match a seeded user or any string):\&lt;/Text\&gt;<br><br>      \&lt;TextInput<br><br>        value={userId}<br><br>        onChangeText={setUserId}<br><br>        placeholder=&quot;e.g. joel&quot;<br><br>        style={{ borderWidth: 1, borderColor: &#39;\#ccc&#39;, borderRadius: 8, padding: 12 }}<br><br>        autoCapitalize=&quot;none&quot;<br><br>      /\&gt;<br><br>      \&lt;Text\&gt;Token server URL\&lt;/Text\&gt;<br><br>      \&lt;TextInput<br><br>        value={serverUrl}<br><br>        onChangeText={setServerUrl}<br><br>        placeholder=&quot;http://10.0.2.2:5050 (Android Emulator)&quot;<br><br>        style={{ borderWidth: 1, borderColor: &#39;\#ccc&#39;, borderRadius: 8, padding: 12 }}<br><br>        autoCapitalize=&quot;none&quot;<br><br>      /\&gt;<br><br>      \&lt;Button title=&quot;Continue&quot; onPress={login} /\&gt;<br><br>    \&lt;/View\&gt;<br><br>  );<br><br>}</pre><p>The next step is to create a new file named \ChannelScreen.tsx\ inside the \src/screens\ folder and paste the code below.</p><pre>import React, { useEffect, useState } from &#39;react&#39;;<br><br>import { ActivityIndicator, View } from &#39;react-native&#39;;<br><br>import { Channel, MessageList, MessageInput, useChatContext } from &#39;stream-chat-expo&#39;;<br><br>import type { StackScreenProps } from &#39;@react-navigation/native-stack&#39;;<br><br>type RootStackParamList \= {<br><br>  ChannelList: undefined;<br><br>  Channel: { channelId: string };<br><br>  NewGroup: undefined;<br><br>};<br><br>type Props \= StackScreenProps\&lt;RootStackParamList, &#39;Channel&#39;\&gt;;<br><br>export default function ChannelScreen({ route }: Props) {<br><br>  const { client } \= useChatContext();<br><br>  const \[chan, setChan\] \= useState\&lt;any\&gt;(null);<br><br>  useEffect(() \=\&gt; {<br><br>    let mounted \= true;<br><br>    (async () \=\&gt; {<br><br>      const c \= client.channel(&#39;messaging&#39;, route.params.channelId);<br><br>      await c.watch();<br><br>      if (mounted) setChan(c);<br><br>    })();<br><br>    return () \=\&gt; { mounted \= false; };<br><br>  }, \[client, route.params.channelId\]);<br><br>  if (\!chan) return \&lt;View style={{ flex:1, justifyContent:&#39;center&#39;, alignItems:&#39;center&#39; }}\&gt;\&lt;ActivityIndicator /\&gt;\&lt;/View\&gt;;<br><br>  return (<br><br>    \&lt;Channel channel={chan}\&gt;<br><br>      \&lt;MessageList /\&gt;<br><br>      \&lt;MessageInput /\&gt;<br><br>    \&lt;/Channel\&gt;<br><br>  );<br><br>}</pre><p>Finally, you’ll create a file named \app.tsx\ in the chat-group folder and paste in the code below. This code writes everything about the login and connects the Stream to the screens.</p><pre>import React, { useEffect, useState } from &#39;react&#39;;<br><br>import { SafeAreaView, StatusBar, View, ActivityIndicator } from &#39;react-native&#39;;<br><br>import { NavigationContainer } from &#39;@react-navigation/native&#39;;<br><br>import { createNativeStackNavigator } from &#39;@react-navigation/native-stack&#39;;<br><br>import { OverlayProvider, Chat, useChatContext } from &#39;stream-chat-expo&#39;;<br><br>import { getStreamClient } from &#39;./src/stream/client&#39;;<br><br>import LoginScreen from &#39;./src/screens/LoginScreen&#39;;<br><br>import ChannelListScreen from &#39;./src/screens/ChannelListScreen&#39;;<br><br>import ChannelScreen from &#39;./src/screens/ChannelScreen&#39;;<br><br>import NewGroupScreen from &#39;./src/screens/NewGroupScreen&#39;;<br><br>type RootStackParamList \= {<br><br>  ChannelList: undefined;<br><br>  Channel: { channelId: string };<br><br>  NewGroup: undefined;<br><br>};<br><br>const Stack \= createNativeStackNavigator\&lt;RootStackParamList\&gt;();<br><br>function ChatStack() {<br><br>  return (<br><br>    \&lt;Stack.Navigator\&gt;<br><br>      \&lt;Stack.Screen name=&quot;ChannelList&quot; component={ChannelListScreen} options={{ title: &#39;Groups&#39; }} /\&gt;<br><br>      \&lt;Stack.Screen name=&quot;NewGroup&quot; component={NewGroupScreen} options={{ title: &#39;New Group&#39; }} /\&gt;<br><br>      \&lt;Stack.Screen name=&quot;Channel&quot; component={ChannelScreen} options={{ title: &#39;Chat&#39; }} /\&gt;<br><br>    \&lt;/Stack.Navigator\&gt;<br><br>  );<br><br>}<br><br>function ConnectedChat({ apiKey, userId, token }: { apiKey: string; userId: string; token: string }) {<br><br>  const \[ready, setReady\] \= useState(false);<br><br>  const client \= getStreamClient(apiKey);<br><br>  useEffect(() \=\&gt; {<br><br>    let mounted \= true;<br><br>    (async () \=\&gt; {<br><br>      await client.connectUser({ id: userId, name: userId }, token);<br><br>      if (mounted) setReady(true);<br><br>    })();<br><br>    return () \=\&gt; {<br><br>      mounted \= false;<br><br>      client.disconnectUser();<br><br>    };<br><br>  }, \[apiKey, userId, token\]);<br><br>  if (\!ready) return \&lt;View style={{ flex:1, justifyContent:&#39;center&#39;, alignItems:&#39;center&#39; }}\&gt;\&lt;ActivityIndicator /\&gt;\&lt;/View\&gt;;<br><br>  return (<br><br>    \&lt;OverlayProvider\&gt;<br><br>      \&lt;Chat client={client}\&gt;<br><br>        \&lt;ChatStack /\&gt;<br><br>      \&lt;/Chat\&gt;<br><br>    \&lt;/OverlayProvider\&gt;<br><br>  );<br><br>}<br><br>export default function App() {<br><br>  const \[session, setSession\] \= useState\&lt;{ apiKey: string; userId: string; token: string } | null\&gt;(null);<br><br>  return (<br><br>    \&lt;SafeAreaView style={{ flex: 1 }}\&gt;<br><br>      \&lt;StatusBar /\&gt;<br><br>      \&lt;NavigationContainer\&gt;<br><br>        {session ? (<br><br>          \&lt;ConnectedChat apiKey={session.apiKey} userId={session.userId} token={session.token} /\&gt;<br><br>        ) : (<br><br>          \&lt;LoginScreen onLoggedIn={setSession} /\&gt;<br><br>        )}<br><br>      \&lt;/NavigationContainer\&gt;<br><br>    \&lt;/SafeAreaView\&gt;<br><br>  );<br><br>}</pre><h3>Test the Application</h3><p>Now that you’ve built the group chat, the next step is to run the application. To do so, you’ll start the token server following the steps below.</p><p>Navigate to the root folder where the \server.s\ is located and run the command below.</p><pre>npm start</pre><p>After running the command, your terminal should display something related to the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/0*pzC5IaDqU-pnR7Bs" /></figure><p>Finally, open a separate terminal, navigate to the \chat-group\ folder, and run the command below to start the iOS simulator.</p><pre>npm start</pre><blockquote>To run the app, launch it on either an iOS Simulator by pressing “i” or an Android Emulator by pressing “a”. The token server URL is already set by default for both: <a href="http://10.0.2.2:5050/">http://10.0.2.2:5050</a> for Android and <a href="http://127.0.0.1:5050/">http://127.0.0.1:5050</a> for iOS.</blockquote><p>Once in the app, log in as Alice or any of the other seeded users. To start a new chat, tap on a new group, select at least two users from the list, and then tap create. You can now begin chatting within the new group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*6mOv0l1SMGEXIsOQ" /></figure><p>Below is a screenshot from the group chat before implementing the Stream AI moderator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/0*M73qy8BFSCPodtAE" /></figure><blockquote>From the screenshot above, you can see several abusive slurs and profanity words being used, but none are flagged or blocked. That’s because you have not introduced the moderator yet.</blockquote><h3>Introduction to Group Chat Moderation with Stream</h3><blockquote>Stream’s <a href="https://getstream.io/moderation/">AI-powered moderation</a> API works natively with Stream’s Chat, Video, and Activity Feeds APIs, and it also works with inhouse experiences to automatically detect and act on a wide range of harmful content across text, images, live video, and audio.</blockquote><p>Here’s a condensed list of some supported harms and categories:</p><ul><li>Spam: unsolicited or repetitive messages.</li><li>Hatred: abusive or threatening language.</li><li>Racism: discriminatory or prejudiced comments based on race or ethnicity.</li><li>LGBTQIA+ phobia: negative or hostile comments towards LGBTQIA+ individuals.</li><li>Misogyny: comments that express hatred or prejudice against women.</li><li>Ableism: discriminatory or prejudiced comments based on physical or mental disabilities.</li><li>Threat: statements expressing an intention to cause harm or violence to someone.</li><li>Terrorism &amp; violent extremism: support or promotion of terrorist activities or ideologies.</li><li>Pedophilia: comments that express sexual interest in minors.</li><li>Scam: fraudulent schemes or deceptive practices.</li><li>Flood: excessive or repetitive posting of messages.</li><li>Forbidden link: sharing links to prohibited or harmful websites.</li></ul><p>Stream’s moderation system works by analyzing messages in real-time and taking action based on <a href="https://getstream.io/moderation/docs/dashboard/configuring-policy/">configurable policies</a>. You can choose to:</p><ul><li>Flag messages: Mark messages for review by a human moderator.</li><li>Block messages: Prevent other users from seeing your messages.</li><li><a href="https://getstream.io/glossary/ban/">Ban</a> users: Temporarily or permanently block users from sending messages.</li><li>Shadow block.</li><li>Bounce and block.</li><li>Bounce and flag.</li></ul><h3>Using Advanced AI Moderation Engines</h3><p>While flagging, blocking, and banning are foundational tools in moderating group chat, they lack the nuance and adaptability needed for large and dynamic communities. Stream’s AI-powered moderation goes beyond these simple actions, offering sophisticated engines that understand intent, context, and subtlety.</p><p>Here’s what you gain:</p><h4>AI Text Harm Detection (LLM)</h4><blockquote>The <a href="https://getstream.io/moderation/docs/engines/ai-text/">AI text harm</a> detection uses Large Language Models to understand context and user intent, instead of only looking for profane words. It can catch subtle or indirect harmful content, like passive-aggressive remarks or harassment, that keyword filters often miss.</blockquote><p>Here’s how it works:</p><p>As a developer, you can set up a few key parameters. First is the app context, which explains what your application is about. This helps the AI understand the background of the conversations. Next are the LLM rules, where you define harm labels and what they mean in your app. For example, you can explain what counts as “scam” or “hate speech” for your community. Stream then combines your app context, your rules, and the last few messages in a conversation.</p><p>With a bit of prompt engineering, it sends this to the LLM and asks it to classify the message based on the rules you provided.</p><p>Configuration:</p><p>Get started! Activate your <a href="https://getstream.io/try-for-free/">free Stream account today</a> and start prototyping your chat app.</p><p>You can set up the LLM moderation engine directly in the Stream dashboard. Follow these steps:</p><ul><li>Log in to your <a href="https://dashboard.getstream.io/">Stream dashboard</a>.</li><li>Go to Moderation in the sidebar.</li><li>Open Policies.</li><li>Select the policy you want to update.</li><li>Click on AI (LLM) Text.</li></ul><p>From here, you can choose harm categories, set actions like bounce and flag, bounce and block, and adjust sensitivity levels.</p><p>See the screenshot below for guidance on what it looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7iN9kymn15MujBrO" /></figure><h4>AI Text Harm Detection (NLP) with Blocklists and Regex Filtering</h4><blockquote>A layered approach works best. Blocklists such as profanity_en_2020_v1 and regex rules give you fast and predictable filtering, while the <a href="https://getstream.io/moderation/docs/engines/ai-text/">NLP engine</a> adds extra understanding of meaning. This makes it easier to tell the difference between harmless mentions and real violations.</blockquote><p>Configuration:</p><p>To set up the AI Harm Engine, go to the AI Text section in your moderation policy. You will see a list of harm categories that the AI can detect, such as harassment, hate speech, spam, and explicit content.</p><p>For each category, you can choose what should happen: flag the message, block it, or shadow block it. You can also change the sensitivity level for different types of harmful content. This helps you fine-tune moderation to match your community.</p><p>It is usually best to start with lighter settings and then adjust as you learn more about how people in your community interact.</p><h4>Severity Levels</h4><p>The AI Text moderation engine can label harmful content as Low, Medium, High, or Critical. These levels are mainly used for toxic categories like hate speech or sexual harassment.</p><p>For each severity level, you can choose what action should happen. For example, flag, block, or shadow block.</p><p>See the screenshot below for how this looks in the dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4kSV1jpxOahkUpWh" /></figure><h3>Setting up Stream and Enabling Moderation</h3><blockquote>Now that your project is set up, the next step is configuring Stream and enabling the AI moderation features. <a href="https://getstream.io/try-for-free/">Create your free account</a> to log in to your Stream dashboard and create a new application. You’ll find your API key and secret in the app’s settings.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RPiUa3aCFYswNpwN" /></figure><p>You can manage policies entirely in the dashboard with the lowest friction. Set rules (AI text/image engines, blocklists) and apply them to chat via config keys like \chat:messaging\, all messaging channels, and Stream. The dashboard lets you monitor the content flagged by your configured policies and provides tools to fine-tune those policies based on real data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6t2x7ClcCeyAa3yb" /></figure><h3>Setting up Moderation Policy</h3><blockquote>Within your Stream dashboard, you can configure your chat moderation settings. Begin by selecting the Chat section, then open the Moderation tab. From this screen, you’ll be able to enable Stream’s built-in moderation tools and apply the profanity_en_2020_v1 blocklist to filter out profanity.</blockquote><p>For this tutorial, you will enable all the moderation categories and set the action to flag. This will automatically flag any harmful messages sent to the group chat.</p><p>Later, you can switch to the ‘block’ option by changing your Stream dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ubnu4lhgWpe4FFb9" /></figure><h3>Implementing Moderation in the Group Chat</h3><p>To add moderation to your group chat, you need to set up rules in your Stream dashboard. This allows you to take action against harmful content such as threats, self-harm, harassment, etc from the moderation/policies section.AI moderation policy and set the AI: Text to block</p><h3>The Main App Component (Updated App.tsx)</h3><p>The main \*App.tsx\* file will handle the initialization of the Stream client and the navigation between the channel list and the chat screen.</p><p>When you switch users, connecting and disconnecting should be clean. The server’s webhook will post a single notice so you won’t see duplicate messages. For a smooth user experience, you can use \additionalFlatListProps\ to help users scroll to older messages easily.</p><pre>import React, { useEffect, useState, useCallback } from &#39;react&#39;;<br><br>import { SafeAreaView } from &#39;react-native&#39;;<br><br>import {<br><br>  Chat,<br><br>  ChannelList,<br><br>  Channel,<br><br>  MessageList,<br><br>  MessageInput,<br><br>  OverlayProvider,<br><br>} from &#39;stream-chat-react-native&#39;;<br><br>import { StreamChat } from &#39;stream-chat&#39;;<br><br>const backend \= &#39;http://localhost:5050&#39;; <br><br>const chatClient \= StreamChat.getInstance(&#39;dummy&#39;); <br><br>export default function App() {<br><br>  const \[ready, setReady\] \= useState(false);<br><br>  const \[activeChannel, setActiveChannel\] \= useState\&lt;any\&gt;(null);<br><br>  const userId \= &#39;alice&#39;;<br><br>  useEffect(() \=\&gt; {<br><br>    (async () \=\&gt; {<br><br>      const resp \= await fetch(\`${backend}/token?user\_id=${userId}\`).then(r \=\&gt; r.json());<br><br>      const client \= StreamChat.getInstance(resp.apiKey);<br><br>      await client.connectUser(<br><br>        {<br><br>          id: userId,<br><br>          name: &#39;Alice&#39;,<br><br>          image: &#39;https://getstream.io/random\_png/?id=alice\&amp;name=Alice&#39;,<br><br>        },<br><br>        resp.token<br><br>      );<br><br>      await fetch(\`${backend}/channel\`, {<br><br>        method: &#39;POST&#39;,<br><br>        headers: { &#39;Content-Type&#39;: &#39;application/json&#39; },<br><br>        body: JSON.stringify({ channelId: &#39;demo-general&#39;, members: \[&#39;alice&#39;, &#39;bob&#39;\] }),<br><br>      });<br><br>      (global as any).chatClient \= client; <br><br>      setReady(true);<br><br>    })();<br><br>    return () \=\&gt; {<br><br>      const c \= (global as any).chatClient;<br><br>      if (c) c.disconnectUser();<br><br>    };<br><br>  }, \[\]);<br><br>  const onSend \= useCallback(async (message: any) \=\&gt; {<br><br>    try {<br><br>      await activeChannel.sendMessage(message);<br><br>    } catch (e: any) {<br><br>      alert(e?.message ?? &#39;Message rejected by moderation rules.&#39;);<br><br>    }<br><br>  }, \[activeChannel\]);<br><br>  if (\!ready) return null;<br><br>  return (<br><br>    \&lt;OverlayProvider\&gt;<br><br>      \&lt;SafeAreaView style={{ flex: 1 }}\&gt;<br><br>        \&lt;Chat client={(global as any).chatClient}\&gt;<br><br>          {activeChannel ? (<br><br>            \&lt;Channel channel={activeChannel}\&gt;<br><br>              \&lt;MessageList /\&gt;<br><br>              \&lt;MessageInput onSend={onSend} /\&gt;<br><br>            \&lt;/Channel\&gt;<br><br>          ) : (<br><br>            \&lt;ChannelList<br><br>              filters={{ type: &#39;messaging&#39;, members: { $in: \[&#39;alice&#39;\] } }}<br><br>              sort={{ last\_message\_at: \-1 }}<br><br>              onSelect={(ch) \=\&gt; setActiveChannel(ch)}<br><br>            /\&gt;<br><br>          )}<br><br>        \&lt;/Chat\&gt;<br><br>      \&lt;/SafeAreaView\&gt;<br><br>    \&lt;/OverlayProvider\&gt;<br><br>  );<br><br>}</pre><h3>Test the Application</h3><p>To test the application, you’ll first navigate to the root folder or the backend folder where the \server.js\ is located, then open the terminal and paste the command below:</p><pre>node server.js</pre><p>After running the command below, you should see something related to the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IrVQAjz673B-qv1I" /></figure><p>Second, you have to open a new terminal different from the above to start Ngrok. Before you continue to run the application, you can copy the commands below to run the server.</p><pre>ngrok http 5050</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ABE-_Iek1vcpri6m" /></figure><p>Copy the \https://e353facdfb71.ngrok-free.app/webhook\ URL and paste it in your Stream webhook event and configuration. Make sure you tick the box labeled “subscribe to all current and future events,” then click Submit to save the webhook, as shown in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SwN_kK7-5f-NtwgQ" /></figure><p>Then open another terminal and navigate to the Stream Chat folder from the root folder by pasting the command below:</p><pre>cd rn-stream-chat</pre><p>Copy the command below to start the emulator:</p><pre>npx expo start \-c  </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vAlwm8LFgusLdQ27" /></figure><p>After running the command above, you will get a list of commands. Just reply with the letter ‘I’, and it will open the emulator window, where you will see the group chat members list.</p><h3>The Chat List Screen</h3><p>The chat list screen will display a list of available members. You can select a chat name or create a custom name to join the conversation in the group chat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*keCksFQUJYit_mFp" /></figure><h3>The Chat Screen</h3><p>The chat screen is where the magic happens. This is where users can send and receive messages. Our AI moderator will be at work, removing spam messages before they’re delivered — as seen in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KbpfqXCYrVvR241_" /></figure><h3>Testing the AI Moderator</h3><p>Once you have the application running, you can test the AI moderator by sending messages that violate the rules you’ve configured in your Stream dashboard. For example, you can try sending words from the \profanity\_2020\ list.</p><p>You should see that these messages are automatically blocked and not visible to other users in the chat, as shown in the short video below and in the Stream Moderation dashboard screenshot.</p><p>Below is a new test with two different iOS emulators.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p1VMlV06t-ks9fF9" /></figure><p>Below is a screenshot from the chat explorer dashboard showing the allowed and blocked messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_Er_qRX3Y20VWxvf" /></figure><h3>What’s Next?</h3><p>You now have a fully functional React Native group chat that uses Stream to detect and block harmful or inappropriate messages in real time. The app securely connects users, allows seamless user switching without crashes, and loads older conversations smoothly as you scroll.</p><blockquote>When <a href="https://getstream.io/blog/build-chat-messaging-app/">building a chat app</a>, it’s your responsibility to create a safe and respectful environment where your community can thrive. Without proper moderation, toxicity, spam, and harassment can quickly overwhelm online spaces, driving users away.</blockquote><p>Stream’s AI Moderation API makes it easier for developers to scale communities responsibly by automatically detecting and filtering harmful content, reducing the burden on human moderators, and helping maintain a positive experience for all participants.</p><blockquote>Check out the <a href="https://github.com/Saintdavidking/Group-chat-using-Stream-and-ReactNative">GitHub repository</a> for the complete code.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c25c2ec595c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AI Agents Are Changing the Future of Web Scraping]]></title>
            <link>https://medium.com/@davidfagb/how-ai-agents-are-changing-the-future-of-web-scraping-a19f836ae803?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/a19f836ae803</guid>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Tue, 14 Oct 2025 16:03:40 GMT</pubDate>
            <atom:updated>2025-10-14T16:08:30.183Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Future of Web Scraping Cover image" src="https://cdn-images-1.medium.com/max/800/0*DnwbsCnISiZBXxjM.png" /><figcaption>Future of Web Scraping</figcaption></figure><p>In today’s world of data collection, intelligent AI agents are transforming how we approach data. Instead of using fixed scripts that stop working when a webpage changes, these agents can think, understand, and adjust, making data extraction stronger, more accurate, and smarter.</p><p>In this article, we examine how these ing paradigms and solutions, such as [OloStep](https://www.olostep.com/), are capitalizing on agents as they shift.</p><h4>From Static Scrapers to Adaptive Agents</h4><p>Traditional web scrapers are built on fixed rules and selectors. They expect pages to follow consistent HTML structures and often fail when sites update. Autonomous agents instead observe patterns, reason about structure, perform corrective actions, and recover from failures. They can decide when to click a “load more” button or when to scroll further. They can detect missing fields or empty responses and retry or choose an alternate path.<br>Because these agents act based on high-level goals rather than brittle scripts, they can survive changes in page layout and dynamic content more gracefully. They are more robust to JavaScript rendering, infinite scroll, asynchronous loading, and unexpected content shifts.</p><h4>Why Web Scraping Matters for AI Agents</h4><figure><img alt="Why Web Scraping Matters for AI Agents" src="https://cdn-images-1.medium.com/max/800/0*1-8sgv2xSsSuSWbf.png" /><figcaption>Why Web Scraping Matters for AI Agents</figcaption></figure><p>AI agents need fresh data. They cannot operate solely on training data or outdated snapshots. Scraped web data gives them the real-time sight and sound of the internet. It enables:</p><ul><li>Sensing changing prices, new product listings, or shifts in sentiment</li><li>Validating assumptions with live examples</li><li>Triggering downstream workflows or actions based on updated facts</li></ul><p>Autonomous agents transform web scraping from a background utility into a primary component. The faster the data, the more intelligent the agent.</p><h4>How OloStep Enables Smarter Agents</h4><p>[OloStep](docs.olostep.com) presents itself as a unified web data API built for AI and research agents. It supports crawling, parsing, routing, automation, and workflows behind the scenes. It exposes features such as click and form fill, distributed infrastructure, and parsing engines. OloStep also maintains low latency, typically between two and six seconds, by combining optimized infrastructure and logic.</p><p>Additionally, OloStep enables agents to reason about which pages to crawl, which subpages to explore, and how to filter results. Agents using OloStep do not need to manage the plumbing of proxies, anti-blocking measures, or parser maintenance. The agent issues high-level commands, and OloStep handles extraction, cleaning, formatting, and delivery.</p><p>Because OloStep converts websites into structured outputs and enables agents to build higher-level workflows, it transforms the web into a real-time database usable by agents and applications. In effect, OloStep abstracts away the messy details, allowing agents to focus on reasoning and decision-making.</p><h4>Key Capabilities of Autonomous Scraping Agents</h4><p>Here are several capabilities that distinguish modern scraping agents:</p><ol><li><strong>Goal-driven workflows</strong>: Agents receive intents, such as “collect top 100 product listings for brand X,” and orchestrate multiple steps, including crawling, filtering, logging in, pagination, and error recovery.</li><li><strong>Dynamic adaptation</strong>: When a page fails, when elements shift, agents can detect anomalies, adjust selectors, or pivot strategies rather than fail outright.</li><li><strong>Self-improvement</strong>: Some agents can learn reusable “skills” (for example, how to navigate a site or extract tables) and refine their library over time. As agents accrue experience, they become faster and more accurate.</li><li><strong>Collaborative human-agent control</strong>: In edge cases, agents may defer to human review or allow human override, improving reliability and trust.</li><li><strong>Scalability across domains</strong>: Because agents reason rather than rely on hand-coded rules, they can scale across many websites, domains, languages, and content types.</li></ol><h4>Challenges and Ethical Considerations</h4><p>Despite their promise, these agents face real challenges:</p><ul><li>Sites fight back. Measures like CAPTCHA, bot detection systems, and active blocking make scraping harder.</li><li>Changes in site licensing, terms of service, or robot policies require agents to follow legal and ethical constraints.</li><li>Agent hallucination or misbehavior risk exists when agents misinterpret content or take unintended actions.</li><li>Infrastructure cost grows when agents operate at scale across many domains.</li><li>Maintaining agent safety, monitoring, auditability and human oversight becomes essential.</li></ul><p>Moreover, the arms race continues: as agents get smarter, websites will adopt more advanced defenses, including behavioral heuristics or dynamic content injection.</p><h4>The Future Landscape</h4><p>Looking ahead, autonomous agents will become a core layer of the web. The concept of a Web of Agents (where agents interact, collaborate, and request services from each other) is already being theorized in academia. In that world, web scraping capabilities will be internalized: agents will query agent services to fetch fresh data rather than building their own scrapers.</p><p>Hybrid systems will dominate. Agents will issue goals while robust scraping platforms like OloStep serve as the reliable data backbone. Agents will compose skills, reuse parsing modules, coordinate across domains, and even negotiate data contracts.</p><p>We will also see specialization. Some agents will focus on financial use cases, while others will concentrate on market monitoring, brand protection, compliance, or social listening. Each will lean on tailored scraping stacks behind the scenes.</p><p>As agents evolve, the boundary between crawling, searching, and reasoning will become increasingly blurred. The future is a world where agents not only read the web but also act on it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a19f836ae803" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Best Tools to Turn Websites into AI-Ready Data]]></title>
            <link>https://medium.com/@davidfagb/5-best-tools-to-turn-websites-into-ai-ready-data-f6dad0f21b3e?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6dad0f21b3e</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[web-scrapers]]></category>
            <category><![CDATA[scrapping]]></category>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Sun, 12 Oct 2025 14:18:05 GMT</pubDate>
            <atom:updated>2025-10-12T14:18:05.795Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine you’re building an LLM app that requires clean, up-to-date web content, product specifications, blog posts, and policies. But every site is its own mess, the HTML, ads, scripts, and weird microcopy. You don’t want raw HTML. You want clean markdown or JSONL, metadata, and embeds ready for chunking, embedding, and pushing into a vector DB.</p><h4>How I picked these five</h4><p>Selection criteria you care about:</p><ol><li><strong>Data quality</strong> (HTML → Markdown / clean text / JSONL)</li><li><strong>LLM &amp; vector-DB friendliness</strong> (embeddings pipeline, LangChain integrations, Pinecone/Weaviate exports)</li><li><strong>Scalability &amp; real-time</strong> (APIs, crawl scheduling, proxies)</li><li><strong>Legal &amp; ethical compliance</strong> (terms, takedown handling, human review where relevant)</li><li><strong>Developer ergonomics</strong> (no-code UI, SDKs, output formats).</li></ol><p>Here are five tools that make that dream real, and why Olostep should be the first thing you try.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8lZyRUdAKxmmwXdU-DMZw.png" /></figure><h4>Olostep — from URL to LLM-ready content, fast</h4><p>If your priority is getting <em>clean markdown</em> or structured JSON directly from a URL, Olostep feels built for that last-mile moment before an LLM. It advertises simple endpoints that convert pages into Markdown, structured fields, and enables you to produce JSONL for embeddings without a full cleaning pipeline. For teams who treat web pages as content to be read (not raw HTML to parse), Olostep removes steps and friction. (<a href="https://olostep.com/blog/turn-websites-into-llm-ready-data?utm_source=chatgpt.com">Olostep</a>)</p><p><strong>Why use it:</strong> Minimal transformation work, output formats that match LLM ingestion patterns, and a developer-first API that can slot directly into an RAG or vector DB pipeline.</p><h4>Spidra — no-code + LLM assistance for tricky pages</h4><p>Spidra takes a different angle: a no-code interface that simulates real browser actions (click, scroll, fill), with LLM-driven extraction helpers for odd layouts. It’s great when you need human-like interaction to reveal content (lazy-loaded sections, gated lists) and want to export structured records without writing a spider. If you prefer GUI builds and occasional manual tuning, Spidra reduces the ramp. (<a href="https://spidra.io/?utm_source=chatgpt.com">spidra.io</a>)</p><p><strong>Why use it:</strong> Fast for one-off or low-code pipelines where human-style navigation matters.</p><h4>Apify — the flexible platform for custom pipelines</h4><p>Apify is the go-to when you need control: custom actors, scheduled crawls, and a marketplace of scrapers. It’s built to scale and to integrate with downstream systems — you can generate structured outputs, run post-processing, and push results to storage or an LLM pipeline. If your project grows from POC to product, Apify gives the building blocks. (<a href="https://apify.com/?utm_source=chatgpt.com">Apify</a>)</p><p><strong>Why use it:</strong> Highly customizable, great for teams that expect to iterate on scraper logic and orchestration.</p><h4>Bright Data — enterprise-grade scale and proxy coverage</h4><p>When scale and reliability across multiple geo-targets matter, Bright Data’s integrated proxy and scraping offerings are hard to beat. They emphasize large proxy pools and managed scrapers, which help keep long-running crawls healthy and less likely to be blocked. For enterprise data collection to feed large LLMs, reliability matters. (<a href="https://brightdata.com/?utm_source=chatgpt.com">Bright Data</a>)</p><p><strong>Why use it:</strong> Best choice for high-volume, geo-targeted extraction where anti-block and uptime are critical.</p><h4>Zyte &amp; ecosystem tools — LLM-friendly best practices</h4><p>Zyte (and players in its orbit) have focused on integrating LLMs using AI-assisted selectors, QA, and RAG-style approaches for search-and-extract. If your scraping is research-heavy, tools from this space help with quality checks and smarter extraction logic — the kind that reduces garbage data entering your embeddings. (<a href="https://www.zyte.com/webinars/llms-in-web-scraping-a-2025-roundup-from-zytes-data-science-leaders/?utm_source=chatgpt.com">Zyte #1 Web Scraping Service</a>)</p><p><strong>Why use it:</strong> Strong on extraction quality, developer tooling, and best practices for LLM feeding.</p><h4>How to choose (short checklist)</h4><ol><li><strong>Output format:</strong> Need markdown or JSONL out-of-the-box? Prioritize Olostep or Apify.</li><li><strong>Interaction:</strong> Do you need clicks or form fills? Spidra or Apify (browser automation).</li><li><strong>Scale &amp; geo:</strong> Big volume + geotargeting → Bright Data.</li><li><strong>Quality &amp; QA:</strong> If you need smart extraction and LLM-assisted checks, look at Zyte and Apify.</li><li><strong>Compliance:</strong> Always respect robots.txt and site terms, rate-limit requests, and prefer ethically sourced proxies or managed platforms to reduce legal risk.</li></ol><h4>Why Olostep is the everyday choice for LLM builders</h4><p>If your goal is “feed an LLM or a vector DB right now,” Olostep shines because it <strong>reduces transformation work</strong>: fewer cleaning steps, native markdown/JSON outputs, and a direct API path into embeddings or RAG pipelines. For fast experiments or production flows that demand consistent, LLM-ready records, it’s the pragmatic first stop.</p><p>Try Olostep for the initial ingest, and add Apify or Bright Data later as your scale or interaction needs grow. (<a href="https://www.olostep.com/?utm_source=chatgpt.com">Olostep</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6dad0f21b3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 6 Web Scraping APIs for Developers in 2025]]></title>
            <link>https://medium.com/@davidfagb/top-6-web-scraping-apis-for-developers-in-2025-a0691b8f1b9f?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0691b8f1b9f</guid>
            <category><![CDATA[scraper]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[web-scrapers]]></category>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Sun, 12 Oct 2025 13:28:13 GMT</pubDate>
            <atom:updated>2026-08-06T15:15:57.333Z</atom:updated>
            <content:encoded><![CDATA[<p>In the early days of the web, developers wrote simple scripts to fetch pages and parse HTML. A few lines of Python, a requests call, and maybe a BeautifulSoup import, and you could harvest the world’s data like picking apples from an open orchard.</p><p>However, as websites grew more dynamic, JavaScript-heavy, and protected by anti-bot firewalls, the simple approach began to fall apart. The modern web doesn’t just <em>serve</em> data anymore; it <em>hides</em> it behind authentication, React components, and captcha walls.</p><p>That’s why, in 2025, developers no longer build scrapers from scratch. They reach for scraping APIs,<strong> </strong>pre-built engines that handle rendering, rotation, and reliability. These services are the unsung heroes of the AI era, quietly feeding large language models, research dashboards, and e-commerce trackers with fresh, structured web data.</p><figure><img alt="Top 6 Web Scraping APIs for Developers in 2025 cover picture" src="https://cdn-images-1.medium.com/max/1024/1*AIUWE74jFKZ05qfipCNRrA.png" /><figcaption>Top 6 Web Scraping APIs for Developers in 2025 cover picture</figcaption></figure><p>Let’s explore the Top 6 Web Scraping APIs shaping how developers extract, format, and scale web data today, and how each one compares on speed, formats, and developer experience.</p><h4><a href="https://apify.com/">Apify</a> — The Automation Workhorse</h4><p>If Olostep is elegance, Apify is endurance.</p><p><a href="https://apify.com/">Apify</a> has long been the backbone of web automation. Its “Actors” — prebuilt scraping scripts for popular sites — make it a dream for developers who want flexibility and scale. Need to crawl Amazon listings or extract real estate data? Someone’s already built that Actor.</p><p>Apify’s strength lies in community scripts, integrations, and workflow orchestration. You can connect crawlers to storage, queues, or even AI post-processors with minimal setup.</p><ul><li><strong>Speed &amp; Success Rate:</strong> Moderate to high, depending on the Actor setup.</li><li><strong>JS Handling:</strong> Uses headless browsers (Playwright, Puppeteer).</li><li><strong>Formats:</strong> JSON, CSV, HTML.</li><li><strong>Cost per 1,000 requests:</strong> Mid-range; pricing based on compute units.</li><li><strong>Developer Experience:</strong> Feature-rich, slightly steeper learning curve.</li></ul><p>Apify remains the veteran choice for those who need <strong>customization over simplicity</strong>.</p><h4><a href="http://spidra.io/">Spidra</a> — The AI-Enhanced Scraper</h4><p>If Olostep is precision, <a href="https://spidra.io/"><strong>Spidra</strong></a> is instinct. Spidra is an AI-enhanced web crawler that dynamically crawls sites, rather tha<strong>n </strong>relying on hard-coded selectors. It combines a crawling, extraction, and summarization workflow, enabling you to access all products on the site,” a more efficient approach.</p><p>Its machine-learning-powered “auto-extract” feature identifies meaningful sections (titles, prices, content blocks) automatically. Developers love its “crawl intent” model; you tell it <em>what</em> you want, and it determines the best way to obtain it.</p><ul><li><strong>Speed:</strong> 8.5/10 — adaptive crawling</li><li><strong>Formats:</strong> JSON, structured tables</li><li><strong>JS Handling:</strong> Yes, AI-controlled browser sessions</li><li><strong>Cost per 1,000 requests:</strong> Competitive mid-range</li><li><strong>Best for:</strong> AI-driven extraction, e-commerce, and dynamic sites</li></ul><figure><img alt="Spidra" src="https://cdn-images-1.medium.com/max/1024/1*AnpLfTer8PJCUczHnYgI-A.png" /><figcaption>Spidra</figcaption></figure><p>Spidra feels like the bridge between human intuition and automation — a scraper that thinks before it scrapes.</p><h4>SearchAPI — Best for Search Engine Data and SEO</h4><p>If your goal is to collect search engine results instead of scraping arbitrary websites, <a href="https://www.searchapi.io/">SearchAPI</a> is a strong choice. It provides structured JSON data from Google, Bing, Google Maps, Shopping, News, Images, and other search engines through a simple REST API. SearchAPI handles proxies, CAPTCHA solving, geolocation, and parsing behind the scenes, allowing developers to focus on building applications rather than maintaining scraping infrastructure.</p><h4><strong>Pros of SearchAPI</strong></h4><ul><li>Returns structured JSON instead of HTML.</li><li>Supports Google, Bing, Maps, News, Shopping, Images, and other search engines.</li><li>Built in geolocation and premium proxies.</li><li>Pay only for successful requests.</li><li>Excellent documentation and quick integration.</li><li>100 free requests for testing.</li></ul><h4><strong>Cons </strong>of SearchAPI</h4><ul><li>Designed primarily for search engine results rather than scraping any website.</li><li>Less flexible than browser-based scraping APIs such as ScrapingBee or ScraperAPI when you need to interact with arbitrary JavaScript-heavy pages.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4L7oHCfaI-PCIV0XZS63_Q.png" /><figcaption>SearchAPI dashboard</figcaption></figure><p>Search engine data collection, SEO tools, keyword tracking, rank monitoring, Google Maps data, Shopping results, AI Overview extraction, and market research.</p><h4>ZenRows — The Developer’s Sweet Spot</h4><p>ZenRows balances flexibility and affordability. It handles JS rendering, proxy rotation, and retries, all behind a single API endpoint.<br>It’s ideal for developers who want predictable performance without the overhead of enterprise solutions.</p><ul><li><strong>Speed:</strong> 8.5/10</li><li><strong>Formats:</strong> HTML, JSON</li><li><strong>JS Handling:</strong> Yes</li><li><strong>Cost per 1,000 requests:</strong> Mid-range</li><li><strong>Best for:</strong> Mid-scale scraping operations</li></ul><p>ZenRows is the steady workhorse, not flashy, but dependable.</p><h4>Olostep — The Markdown-First and AI-Ready Scraper</h4><p>Imagine if you could turn <em>any</em> website into clean, AI-digestible text in seconds; that’s Olostep’s superpower.</p><p><a href="https://www.olostep.com/">Olostep</a> is a newcomer that feels like it was built <em>for</em> 2025. Instead of just spitting out HTML, it provides structured Markdown, clean JSON, and even rendered HTML formats that plug directly into AI pipelines and content automation tools.</p><p>Where others focus on “scraping,” Olostep focuses on <strong>data readiness</strong>. Its APIs are designed to feed LLMs, not just databases. Developers can send a single URL or upload a batch of thousands, and within minutes, receive fully parsed, JS-rendered results.</p><ul><li><strong>Speed &amp; Success Rate:</strong> Near-instant for static pages, and surprisingly quick for JavaScript-heavy sites.</li><li><strong>JS Handling:</strong> Full browser rendering with bot-evasion techniques.</li><li><strong>Formats:</strong> HTML, Markdown, JSON, PDF.</li><li><strong>Cost per 1,000 requests:</strong> Low — with generous batch pricing and free tier credits.</li><li><strong>Developer Experience:</strong> Lightweight REST API, clean docs, no SDK bloat.</li></ul><figure><img alt="OloStep playground" src="https://cdn-images-1.medium.com/max/1024/1*yCl5p2rxQbpFEFenIj8mkg.png" /><figcaption>OloStep playground</figcaption></figure><p>Olostep feels less like a scraping tool and more like a data pipeline engine,<strong> </strong>ready for anyone building AI agents, automation bots, or analytical dashboards.</p><h4>ScraperAPI — Simplicity That Scales</h4><p>ScraperAPI’s appeal is its plug-and-play simplicity. You make an API call, it returns a fully rendered page, no proxy management, no rotating IP headaches.<br>Perfect for teams that want something that “just works.”</p><ul><li><strong>Speed:</strong> 9/10</li><li><strong>Formats:</strong> HTML, JSON</li><li><strong>JS Handling:</strong> Yes</li><li><strong>Cost per 1,000 requests:</strong> Low to moderate</li><li><strong>Best for:</strong> Quick data pulls and prototypes</li></ul><p>ScraperAPI is the <strong>fast food</strong> of scraping — simple, reliable, and always open.</p><h3>Bright Data — The Enterprise Giant</h3><p>Bright Data operates on a different scale, think billions of requests per day across global proxy networks.<br>It’s built for enterprises that can’t afford downtime and need access to the full spectrum of the web.</p><p>It offers managed scraping, proxy rotation, data labeling, and even AI model integration. But it comes at a premium price and complexity level.</p><ul><li><strong>Speed:</strong> 10/10</li><li><strong>Formats:</strong> JSON, CSV</li><li><strong>JS Handling:</strong> Industry-leading</li><li><strong>Cost per 1,000 requests:</strong> High (enterprise-grade)</li><li><strong>Best for:</strong> Large organizations &amp; high-volume data feeds</li></ul><p>Bright Data is the <strong>aircraft carrier</strong> of the scraping world — powerful but not agile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDR7x43Hb3oKxmiOD7gd2g.png" /><figcaption>Comparison Table</figcaption></figure><h3>The Future Belongs to Intelligence, Not Just Access</h3><p>All these tools scrape the web, but only a few <em>understand</em> it; that’s the new line dividing old-school crawlers from AI-ready data platforms.</p><p><a href="https://www.olostep.com/"><strong>Olostep</strong></a> represents that new wave of scrapers built not just to fetch pages, but to <em>interpret</em> them, <em>structure </em>them, and <em>feed</em> them into intelligent systems.</p><p>So if 2023 was about scraping the web, 2025 is about teaching your scraper to think.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0691b8f1b9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turning the Web Into a Real-Time Database with OloStep]]></title>
            <link>https://medium.com/@davidfagb/turning-the-web-into-a-real-time-database-with-olostep-f175e956a603?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/f175e956a603</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 13:29:32 GMT</pubDate>
            <atom:updated>2025-10-08T13:29:32.242Z</atom:updated>
            <content:encoded><![CDATA[<p>You’re building an AI assistant for a startup CEO who needs to monitor competitors, track pricing updates, new hires, and product launches. Straightforward stuff. So, you start hunting for data scraping solutions that are too brittle to break after a minor site change. Most sites do not offer APIs. Google? Buried in ads, captchas, and unstructured results. You hit a wall.</p><p>Then it hits you that the data is all out there, it’s just trapped inside messy webpages. That’s precisely what OloStep is built to fix. Instead of scraping, crawling, or building static indexes, OloStep flips the model. It treats the open web itself as a live, structured, and queryable database in real time.</p><figure><img alt="Illustration of a chaotic web full of HTML pages turning into a clean, structured database view" src="https://cdn-images-1.medium.com/max/1024/1*kCHsAMclE1H0wYXNZjqlIA.png" /></figure><h4>The Web Wasn’t Meant to Be Queried</h4><p>The internet is one of the most extensive and valuable datasets in history. However, it was not designed for structure, but it was created for publishing.</p><p>There are billions of pages, including blogs, product listings, pricing tables, and job boards, which are constantly being updated. Yet, querying this information in a traditional manner is nearly impossible. You can crawl, index, and scrape the web, but these methods are often brittle, slow, and quickly become outdated.</p><p>What if, instead, you could treat the open web as if it were your live backend?</p><h3>What is Olostep?</h3><p>Olostep is a powerful web scraping API that efficiently provides e data from any website. It meets the essential demands for fast, reliable, and cost-effective data acquisition, AI development and large-scale data aggregation. rtups, and established companies enhance their data-driven applications and automate workflows.</p><h4>The Core Idea: Query the Open Web Like a Database</h4><p>Think SQL, but the tables are web pages. Think APIs, but the endpoints are search queries. OloStep turns the open web into a real-time knowledge source structured, filterable, and directly useful for agents, workflows, and apps.</p><p>Let’s say you’re building an AI agent that finds pricing trends for B2B SaaS tools. Traditionally, you’d:</p><ul><li>Crawl pages</li><li>Parse them manually</li><li>Store them</li><li>Run queries later</li></ul><p>But with OloStep:</p><pre>SELECT price, plan_name, vendor<br>FROM web<br>WHERE category = &quot;CRM software&quot; AND updated_within = &quot;7 days&quot;</pre><p>It’s not a stretch. This is the direction we’re heading to obtain structured results directly from the public internet, without scraping or even relying on pipelines, just answers.</p><figure><img alt="Side-by-side comparison — Left: messy HTML page, Right: clean JSON-like table extracted live]." src="https://cdn-images-1.medium.com/max/1024/1*NL3okKxPHQ4mnYe52GbmvQ.png" /><figcaption>Side-by-side comparison — Left: messy HTML page, Right: clean JSON-like table extracted live].</figcaption></figure><h4>What Makes OloStep Different</h4><p>Most tools that extract data from the web fall into one of two buckets:</p><ol><li><strong>Scrapers</strong>: Fast but fragile. Break often, need constant maintenance.</li><li><strong>Knowledge graphs: </strong>Structured but stale. Require time-consuming ingestion pipelines.</li></ol><p>OloStep is different because it utilizes AI-native tools to extract structured data pages in real<strong>-</strong>time. The model understands both layout and meaning. It can:</p><ul><li>Recognize product specs on landing pages</li><li>Pull out job listings across multiple sites</li><li>Extract facts from articles or documentation</li></ul><p>It’s a web-native query engine. No scraping rules. No brittle XPath selectors. If you’re building anything that depends on real-world knowledge, you don’t want to be stuck waiting for someone else to scrape, ingest, and update it for you.</p><figure><img alt="Flowchart showing an AI agent querying OloStep -&gt; real-time web pages -&gt; structured results" src="https://cdn-images-1.medium.com/max/1024/1*jl9B2mmsvoodZF5HbGzcoA.png" /><figcaption>Flowchart showing an AI agent querying OloStep -&gt; real-time web pages -&gt; structured results</figcaption></figure><h4>Why Now? Because the Stack Just Clicked</h4><p>This wasn’t possible five years ago.</p><ul><li><strong>LLMs</strong> were too weak.</li><li><strong>Scrapers</strong> were too brittle.</li><li><strong>Knowledge graphs</strong> were too slow.</li></ul><p>However, now LLMs can comprehend, reason over tables, and infer meaning across web pages in real-time.</p><p>OloStep rides that wave, turning raw web content into structured, semantically rich data at the moment you need it. It’s not just search. It’s understanding<strong>.</strong></p><h3>Use Cases Already Emerging</h3><p>Below are the benefits of implementing OloStep:</p><ul><li>AI Research Agents: agents that answer questions by citing live data from across the web, not just summaries from cached pages.</li><li>Competitive Intelligence: pull pricing changes, product launches, or staffing shifts from public pages and career portals.</li><li>Custom Tools &amp; Dashboards: develop internal and public-facing information, such as public tenders, vendor updates, or compliance announcements.</li><li>Programmatic Search: replace brittle Google scraping with structured queries and filters. No hacks. No captchas. Just answers.</li></ul><h4>The Future: Don’t Store the Web. Ask It.</h4><p>OloStep flips the traditional methods so instead of trying to tame the chaos of the internet into a static database, it embraces the mess and makes it readable, understandable, and usable.</p><p>Think of it like this:</p><ul><li>Search gives you links.</li><li>Scraping gives you fragments.</li><li>OloStep provides you with facts, and it does so in real-time.</li></ul><p>So instead of building brittle scraping tools or waiting for someone to publish a dataset, you can now ask the web a question and get structured, filtered, useful data in return.</p><p>The web is no longer just something you read; it’s something you query.</p><h4>Try It Yourself</h4><p>If you’re building agents, dashboards, or any product that depends on fresh, structured information from the real world, OloStep gives you the edge.</p><p>Check it out at <a href="https://olostep.com/">https://olostep.com</a><br>Start asking the web real questions and get real answers.</p><p>With OloStep, you don’t have to.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f175e956a603" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-Time User Login Alerts system with Twilio + Next.js]]></title>
            <link>https://medium.com/@davidfagb/real-time-user-login-alerts-system-d69-2d691b1cd08b?source=rss-d1058d8a6759------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d691b1cd08b</guid>
            <category><![CDATA[login]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[airdrops-alert]]></category>
            <category><![CDATA[strapi]]></category>
            <dc:creator><![CDATA[David Fagbuyiro]]></dc:creator>
            <pubDate>Fri, 26 Sep 2025 15:41:16 GMT</pubDate>
            <atom:updated>2025-09-26T16:11:40.324Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rxN9e4iKXhu_wysaKoTIuA.png" /><figcaption>Cover image for: Real-Time User Login Alerts system with Twilio + Next.js</figcaption></figure><p>Sometimes, you want to know immediately when a user logs into your app, whether it’s for security reasons, user activity monitoring, or simply keeping track of engagement. Real-time login alerts can help you detect unauthorized access attempts or provide useful analytics.</p><p>In this tutorial, we’ll show you how to send real-time SMS alerts using Twilio whenever a user signs in. You’ll build this system using [Next.js](<a href="https://nextjs.org/docs">https://nextjs.org/docs</a>), [Strapi](<a href="https://strapi.io/">https://strapi.io</a>), and [Twilio](<a href="https://console.twilio.com/">https://console.twilio.com/</a>), and you can test it locally using ngrok.</p><p>* Next.js will serve as the frontend framework, offering a fast, modern, and highly customizable interface for your app’s login screen. It supports API routes out of the box, which simplifies handling backend logic in a unified codebase.</p><p>* Strapi, a powerful open-source headless CMS, will manage user authentication and act as the backend. It provides a ready-to-use user model and robust authentication system with minimal setup, saving you time and letting you focus on core functionality.</p><p>* Twilio will handle the real-time SMS delivery. Once a user logs in, your application will use Twilio’s programmable messaging API to send a notification that includes the user’s email, IP address, and login timestamp.</p><h4>Prerequisites</h4><p>- <a href="https://nodejs.org/en/learn/getting-started/introduction-to-nodejs">Node.js</a> and npm installed<br>- Basic <a href="https://nextjs.org/docs">Next.js</a> app set up<br>- <a href="https://console.twilio.com/">Twilio</a> account with verified phone number<br>- <a href="https://ngrok.com/)">Ngrok</a> installed (for optional webhook testing)<br>- Strapi instance running (locally or hosted)<br>- <a href="https://www.twilio.com/docs/sendgrid/ui/account-and-settings/api-keys">SendGrid</a>: for sending the emails</p><h4>Creating a new Next.js project</h4><p>To get started with the article, let’s create a new Next.js project using the command below.</p><pre><br>npx create-next-app@latest<br>```</pre><p>Running the application above will prompt you to configure the project. Then configure it as shown below.</p><pre><br>What is your project named? my-app<br>Would you like to use TypeScript? No / Yes<br>Would you like to use ESLint? No / Yes<br>Would you like to use Tailwind CSS? No / Yes<br>Would you like your code inside a `src/` directory? No / Yes<br>Would you like to use App Router? (recommended) No / Yes<br>Would you like to use Turbopack for `next dev`? No / Yes<br>Would you like to customize the import alias (`@/*` by default)? No / Yes<br>What import alias would you like configured? @/*<br>```</pre><h4>Creating the project structure</h4><p>The project structure includes a `.env` file at the root, which will be used to store Twilio credentials securely. Inside the pages directory, there’s an api folder containing notify-login.js, which serves as the backend API route to send SMS alerts using the Twilio SDK. This function reads credentials from the environment and sends a login notification to a specified phone number. <br>The `test-login.js` page provides a simple frontend with a button that triggers this API, simulating a user login and prompting an SMS alert. The `index.js` file serves as the homepage, linking to the test login page.</p><p>This setup allows you to simulate and verify SMS alerts during user logins, laying the groundwork for integration with real authentication flows later. Running the app with. and visiting `/test-login` triggers the alert system, confirming server locally, up correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*SOAy1t3ehF1H0v_6.png" /></figure><h4>Setting up Twilio</h4><p>Next, log in to your <a href="https://console.twilio.com/">Twilio Console</a> to retrieve your Account SID, Auth Token, and Twilio phone number, as you can see in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6jBYeEVdhLqlxy20.png" /></figure><p>Then, use them to replace `&lt;your_twilio_account_sid&gt;`, `&lt;your_twilio_auth_token&gt;`, and `&lt;your_twilio_phone_number&gt;`, respectively, in `.env`.<br>This information is necessary because it authenticates your application with Twilio’s API, allowing it to send and receive SMS messages securely. The Twilio phone number serves as your application’s sender ID, allowing with real mobile eive message status updates viawebhooks.</p><h4>Create the environment variables</h4><p>To keep your API keys and other important information safe, use environment variables in a `.env file`. Start by creating a .env file in your your Strapi folder and adding the keys you need there.</p><pre>APP_KEYS=key1,key2,key3,key4<br>API_TOKEN_SALT=replace_me<br>ADMIN_JWT_SECRET=replace_me<br>JWT_SECRET=replace_me<br>EMAIL_SMTP_HOST=smtp.sendgrid.net<br>EMAIL_SMTP_PORT=587<br>EMAIL_SMTP_SECURE=false<br>EMAIL_SMTP_USER=apikey<br>EMAIL_SMTP_PASS=your_sendgrid_api_key<br>EMAIL_DEFAULT_FROM=alerts@yourdomain.com<br>EMAIL_DEFAULT_REPLY_TO=alerts@yourdomain.com<br>ALERT_RECIPIENT_EMAIL=alerts.receiver@example.com<br>TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br>TWILIO_AUTH_TOKEN=your_twilio_auth_token<br>TWILIO_FROM=+1234567890<br>ALERT_RECIPIENT_PHONE=+234XXXXXXXXXX<br>HOST=0.0.0.0<br>PORT=1337<br><br></pre><p>These environment variables help your app work with Twilio and Strapi. `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` are similar to your Twilio username and password; they enable your app to send messages through Twilio. `TWILIO_PHONE_NUMBER` is the Twilio number that sends the SMS, and `ALERT_RECIPIENT_NUMBER` is the phone number that will receive the login alert. `NEXT_PUBLIC_STRAPI_URL` is the web address of your Strapi backend, which your Next.js app uses to connect to Strapi and check login details.</p><h4>Installing Twilio SDK</h4><p>To enable the application to send SMS to users, we need to install the Twilio <a href="https://www.twilio.com/docs/libraries">SDK</a> into the project. To do that, run the command below.</p><pre>npm install Twilio</pre><h4>Setting up Strapi to Send Email Alerts</h4><p>To complement your SMS alerts, you’ll also send email notifications using Strapi. This is useful for backup notifications or sending alerts to multiple recipients.</p><h4>Strapi Installation and Setup</h4><p>Create a folder where both your Strapi and Next.js app will reside. Give it any name. Now navigate to the folder and run the command below in your terminal. Ensure you are in the directory where you want to keep both your Strapi backend and Next.js frontend.</p><pre>npx create-strapi@latest</pre><p>The command above will display the details below:</p><pre>? What is the name of your project? strapi-backend<br>…<br>? Please log in or sign up. Skip<br>? Do you want to use the default database (sqlite) ? Yes<br>? Start with an example structure &amp; data? No<br>? Start with Typescript? Yes<br>? Install dependencies with npm? Yes<br>? Initialize a git repository? No</pre><p>Once you have successfully installed Strapi, cd into your strapi project and run the command below.</p><pre><br>npm run develop</pre><p>This should start up your Strapi application in the URL: <a href="http://localhost:1337/admin">http://localhost:1337/admin</a>. Follow the instructions on the screen to continue.</p><p>This is what your Strapi dashboard should look like after registering the new admin:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fU6k6gjQyIJsfax_.png" /></figure><h4>Enable the Email Plugin in Strapi</h4><p>Here, we are going to install the Strapi <a href="https://docs.strapi.io/cms/features/email?_gl=1*1gh6qf0*_gcl_au*MjIxMTAxNzA2LjE3NTM3MDMzNTE">email plugin</a>, run the command below in your terminal:</p><pre>npm install @strapi/plugin-email</pre><h4>Setting up Strapi Email plugin with SendGrid</h4><p>First, you need the email plugin and the SendGrid provider for Strapi.<br>In your Strapi project directory, run:</p><pre>npm install @strapi/plugin-email @strapi/provider-email-sendgrid</pre><p>Or if you use yarn, run:</p><pre>yarn add @strapi/plugin-email @strapi/provider-email-sendgrid</pre><p>For the sake of time and keeping the tutorial simple, click here for a full step-by-step guide to set up Strapi email plugin with SendGrid on the Strapi <a href="https://strapi.io/blog/strapi-email-and-password-authentication-with-nextjs-15-part-1)">blog</a>.</p><h4>Creating the API route to send SMS</h4><p>Now let’s create the part of your frontend project (built with Next.js) that sends the SMS. We’ll do this by adding a file called `notify-login.js` inside the `pages/api` folder.</p><p>This file will receive login details (like the user’s email, IP address, and time of login) through a `POST` request, and then use Twilio to send a text message with that info.</p><p>To do this, open your **Next.js project folder**, go to the `pages/api` folder, and create a new file named `notify-login.js`. This file will handle sending the SMS alert whenever a user logs in.</p><pre>// pages/api/notify-login.js<br>import twilio from &#39;twilio&#39;;<br>const client = twilio(<br> process.env.TWILIO_ACCOUNT_SID,<br> process.env.TWILIO_AUTH_TOKEN<br>);<br>export default async function handler(req, res) {<br> if (req.method !== &#39;POST&#39;) {<br> return res.status(405).json({ message: &#39;Method Not Allowed&#39; });<br> }<br>const { email, ip } = req.body;<br>if (!email || !ip) {<br> return res.status(400).json({ message: &#39;Missing email or IP address.&#39; });<br> }<br>try {<br> await client.messages.create({<br> body: `🔐 Login Alert: ${email} logged in from IP ${ip}`,<br> from: process.env.TWILIO_PHONE_NUMBER,<br> to: process.env.ALERT_RECIPIENT_NUMBER,<br> });<br>res.status(200).json({ message: &#39;Alert sent!&#39; });<br> } catch (error) {<br> console.error(&#39;Twilio Error:&#39;, error);<br> res.status(500).json({ message: &#39;Failed to send alert.&#39; });<br> }<br>}</pre><p>The code above sends a login alert via Twilio SMS when a POST request with `email` and `ip` is received. It uses environment variables for Twilio credentials and sends the alert to the user’s phone number, handling errors and invalid requests appropriately.</p><h4>The Frontend design</h4><p>Next, you will create `test-login.js` Page to simulate a login action by calling the API.</p><p>Copy the code below and paste it into your *test-login.js* file:</p><pre>// pages/api/notify-login.js<br>import twilio from &#39;twilio&#39;;<br>const client = twilio(<br> process.env.TWILIO_ACCOUNT_SID,<br> process.env.TWILIO_AUTH_TOKEN<br>);<br>export default async function handler(req, res) {<br> if (req.method !== &#39;POST&#39;) {<br> return res.status(405).json({ message: &#39;Method Not Allowed&#39; });<br> }<br>const { email, ip } = req.body;<br> if (!email || !ip) {<br> return res.status(400).json({ message: &#39;Missing email or IP address.&#39; });<br> }<br>try {<br> // Step 1: Send SMS via Twilio<br> await client.messages.create({<br> body: `🔐 Login Alert: ${email} logged in from IP ${ip}`,<br> from: process.env.TWILIO_PHONE_NUMBER,<br> to: process.env.ALERT_RECIPIENT_NUMBER,<br> });<br>// Step 2: Send Email via Strapi<br> await fetch(`${process.env.NEXT_PUBLIC_STRAPI_URL}/api/notify-login-email`, {<br> method: &#39;POST&#39;,<br> headers: { &#39;Content-Type&#39;: &#39;application/json&#39; },<br> body: JSON.stringify({ email, ip }),<br> });<br>res.status(200).json({ message: &#39;Alert sent via SMS and Email!&#39; });<br> } catch (error) {<br> console.error(&#39;Alert Error:&#39;, error);<br> res.status(500).json({ message: &#39;Failed to send alert.&#39; });<br> }<br>}</pre><p>The code above defines a simple Next.js page that simulates a user login and triggers an SMS alert using the `/api/notify-login` endpoint. It includes a form where users can enter their email, fetches the user’s public IP using the <a href="https://api.ipify.org)/">api-pify</a>, and sends both the email and IP to the backend API via a POST request.</p><p>The next step is the main Page, known as the <strong>index.js</strong> page, where a placeholder or real login page code would go. You can copy the code below and paste it into your <strong>index.js</strong> file:</p><pre>// pages/index.js<br>import { useState } from &#39;react&#39;;<br>import axios from &#39;axios&#39;;<br>export default function Home() {<br> const [email, setEmail] = useState(&#39;&#39;);<br> const [status, setStatus] = useState(&#39;&#39;);<br> const [loading, setLoading] = useState(false);<br>const getUserIP = async () =&gt; {<br> try {<br> const res = await axios.get(&#39;https://api.ipify.org?format=json&#39;);<br> return res.data.ip;<br> } catch (error) {<br> console.error(&#39;IP Fetch Error:&#39;, error);<br> return &#39;Unknown IP&#39;;<br> }<br> };<br>const handleSubmit = async (e) =&gt; {<br> e.preventDefault();<br> setStatus(&#39;&#39;);<br> setLoading(true);<br>const ip = await getUserIP();<br>try {<br> const res = await axios.post(&#39;/api/notify-login&#39;, { email, ip });<br> setStatus(res.data.message);<br> } catch (err) {<br> setStatus(&#39;Error sending alert.&#39;);<br> }<br>setLoading(false);<br> };<br>return (<br> &lt;main style={{ maxWidth: &#39;400px&#39;, margin: &#39;100px auto&#39;, textAlign: &#39;center&#39; }}&gt;<br> &lt;h1&gt; Login Portal&lt;/h1&gt;<br> &lt;form onSubmit={handleSubmit} style={{ display: &#39;flex&#39;, flexDirection: &#39;column&#39;, gap: &#39;10px&#39;}}&gt;<br> &lt;input<br> type= &quot;email&quot;<br> placeholder= &quot;Enter your email&quot;<br> value={email}<br> onChange={(e) =&gt; setEmail(e.target.value)}<br> required<br> style={{ padding: &#39;10px&#39; }}<br> /&gt;<br> &lt;button type=&quot;submit&quot; disabled={loading} style={{ padding: &#39;10px&#39; }}&gt;<br> {loading ? &#39;Logging in…&#39;: &#39;Login&#39;}<br> &lt;/button&gt;<br> &lt;/form&gt;<br> {status &amp;&amp; &lt;p style={{ marginTop: &#39;20px&#39; }}&gt;{status}&lt;/p&gt;}<br> &lt;/main&gt;<br> );<br>}</pre><p>The code above defines a simple login interface in a Next.js page that collects a user’s email, fetches their public IP address using the <strong>ipify</strong> API, and sends this data to the <strong>/api/notify-login</strong> endpoint via a POST request using <a href="https://axios-http.com/docs/intro">Axios</a>. It includes basic form handling with loading and status states, updating the UI to reflect success or error messages after submission. The UI consists of a centered form with an email input and a submit button, styled inline for simplicity.</p><h4>The External css</h4><p>Next, go to your public folder and create a file named style.css, then copy the code below and paste it into the <strong><em>style.css</em></strong> file.</p><pre>/* public/styles.css */<br>body {<br> font-family: Arial, sans-serif;<br> background: #f8f8f8;<br> margin: 0;<br> padding: 40px;<br>}<br>.container {<br> max-width: 400px;<br> margin: auto;<br> background: white;<br> padding: 30px;<br> border-radius: 8px;<br> box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);<br>}<br>input[type=&quot;email&quot;] {<br> width: 100%;<br> padding: 12px;<br> margin-bottom: 15px;<br> border-radius: 4px;<br> border: 1px solid #ccc;<br>}<br>button {<br> width: 100%;<br> padding: 12px;<br> background-color: #0070f3;<br> color: white;<br> border: none;<br> border-radius: 4px;<br> font-weight: bold;<br> cursor: pointer;<br>}<br>button:hover {<br> background-color: #005bb5;<br>}<br>.status {<br> margin-top: 20px;<br> font-weight: bold;<br>}</pre><p>The CSS code above styles a clean, centered login form with modern input fields, a bold submit button, and a status message section.</p><h4>Testing the application</h4><p>The next step is to run the simple command below in your terminal to start the application:</p><pre>npm run dev</pre><p>After running the command above, you should see something like the image below displayed in your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/0*MWKW1sJ0rRCknGjG.png" /></figure><h4>Ngrok setup</h4><p>Your Next.js app runs at <a href="http://localhost:3000/">http://localhost:3000</a>, but Twilio can’t access that because it’s on your local machine. ngrok gives you a public URL that tunnels to your local server. This is essential for testing Twilio SMS alerts in real time.</p><p>In a new terminal tab, run the command below.</p><pre>ngrok http 3000</pre><p>This URL is now a secure tunnel to your local server, you’ll get output as shown in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DoxjmH4JRIBwOW0F.png" /></figure><h4>Add ngrok URL to Twilio Webhook</h4><p>Once ngrok is running and you’ve obtained a public HTTPS URL (e.g., <a href="https://abcd1234.ngrok.io/">https://abcd1234.ngrok.io</a>), you’ll need to link it to your Twilio number so that incoming messages or events from Twilio are forwarded to your local development server.</p><p>To link your ngrok tunnel to a Twilio SMS webhook, start by visiting the <a href="https://www.twilio.com/console/phone-numbers/incoming">Twilio Console</a> and navigating to the <strong>Phone Numbers </strong>section. Click on the phone number you want to configure. Once you’re on the settings page for that number, scroll down to the <strong>Messaging</strong> section. Look for the field labeled <strong>A Message Comes In</strong>. This is where you provide the URL that Twilio will call when a new message is received.</p><p>In that field, paste your ngrok URL pointing to your local API route, for example: `<a href="https://abcd1234.ngrok.io/api/notify-login%60">https://abcd1234.ngrok.io/api/notify-login`</a>. Be sure to replace `abcd1234` with the actual subdomain that ngrok assigned to your session. Next, select <strong>HTTP POST</strong> as the request method. Once done, scroll down and click <strong>Save</strong> to apply the changes. Twilio will now send incoming SMS data to your local server via the ngrok tunnel.</p><p>Image description can be seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i2jg7q3xVnKeJqTX.png" /></figure><p>Next, visit <a href="http://localhost:3000/">http://localhost:3000/</a>. Then, type in your email address and click on the login button. The localhost page should be displayed as shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XgHBN_e9c_opzrjZ.png" /></figure><p>After you click on the login button, an sms with your information, which includes your IP address and email address, will be sent to your Twilio-registered number, just as shown in the screenshots below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*85-7cQmkcupqbi1-.jpg" /></figure><p>The screenshot above shows the sms alert being received from Twilio with the login information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YwPY457M7febXFnH.jpg" /></figure><p>The image above shows that the login details were received in email from Strapi.</p><h4>That is How to Build Real-Time User Login Alerts system with Twilio + Next.js</h4><p>You’ve now built a complete real-time login alert system using Twilio and Next.js, all from scratch. You created a custom API route to send SMS notifications, designed a test login page, and used an external CSS file for styling. With ngrok, you expose your local server to the internet, allowing Twilio to send requests directly to your API. You also learned how to link your ngrok URL to a Twilio webhook for real-time testing. With everything connected and working, you now have a solid foundation for monitoring user activity and expanding into full authentication systems. You can find the complete source code and setup instructions on my [GitHub repository](<a href="https://github.com/Davidfagb/-User-Login-Alerts-system-with-Twilio-Next.js-and-Strapi">https://github.com/Davidfagb/-User-Login-Alerts-system-with-Twilio-Next.js-and-Strapi</a>).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d691b1cd08b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>